@@ -7,7 +7,10 @@ buildscript {
77 classpath " io.github.gradle-nexus:publish-plugin:$gradleNexusPublishPluginVersion "
88 classpath " com.netflix.nebula:gradle-extra-configurations-plugin:$gradleExtraConfigurationsPluginVersion "
99 classpath " com.bmuschko:gradle-nexus-plugin:$gradleNexusPluginVersion "
10- classpath " gradle.plugin.com.hierynomus.gradle.plugins:license-gradle-plugin:$gradleLicensePluginVersion "
10+ // Due to https://github.com/hierynomus/license-gradle-plugin/issues/161, spring must be excluded
11+ classpath " gradle.plugin.com.hierynomus.gradle.plugins:license-gradle-plugin:$gradleLicensePluginVersion " , {
12+ exclude group : ' org.springframework' , module : ' spring-core'
13+ }
1114 }
1215}
1316
@@ -166,10 +169,19 @@ apply from: "gradle/idea.gradle"
166169subprojects { subproject ->
167170
168171 version = grailsVersion
169- group = " org.grails"
170172
171- ext. isTestSuite = subproject. name. startsWith(" grails-test-suite" )
172- ext. isCiBuild = subproject. hasProperty(" isCiBuild" ) || System . getenv(). get(" CI" ) as Boolean
173+ ext. isTestSuite = subproject. name. startsWith(' grails-test-suite' )
174+ ext. isExample = subproject. name. contains(' grails-test-examples' )
175+ ext. isPlugin = subproject. name in [' grails-async-plugin' , ' grails-events-plugin' ]
176+ ext. isCiBuild = subproject. hasProperty(' isCiBuild' ) || System . getenv(). get(' CI' ) as Boolean
177+ ext. isAsyncProject = subproject. name. startsWith(' grails-async' ) || subproject. name. startsWith(' grails-events' )
178+
179+ if (isPlugin) {
180+ group = ' org.grails.plugins'
181+ } else {
182+ group = ' org.grails'
183+ }
184+
173185 ext. pomInfo = {
174186 delegate. name ' Grails® framework'
175187 delegate. description ' Grails Web Application Framework'
@@ -196,7 +208,6 @@ subprojects { subproject ->
196208 delegate
. email
' [email protected] ' 197209 }
198210 }
199-
200211 }
201212
202213 if (subproject. name != ' grails-bom' ) {
@@ -207,7 +218,7 @@ subprojects { subproject ->
207218 apply plugin : ' project-report'
208219 }
209220
210- if (! isTestSuite) {
221+ if (! isTestSuite && ! isExample ) {
211222
212223 apply plugin : ' maven-publish'
213224 apply plugin : ' signing'
@@ -248,36 +259,36 @@ subprojects { subproject ->
248259
249260 publications {
250261 maven(MavenPublication ) {
251- pom {
252- name = ' Grails® framework'
253- description = ' Grails Web Application Framework'
254- url = ' https://grails.org/'
255-
256- licenses {
257- license {
258- name = ' The Apache Software License, Version 2.0'
259- url = ' https://www.apache.org/licenses/LICENSE-2.0.txt'
260- distribution = ' repo'
261- }
262- }
262+ // Historically async mapped the core libraries to different artifact ids
263+ Map mappedArtifactIds = [
264+ ' grails-async-core' : ' grails-async' ,
265+ ' grails-async-plugin' : ' async' ,
266+ ' grails-events-core' : ' grails-events' ,
267+ ' grails-events-plugin' : ' events'
268+
269+ ]
270+ if (mappedArtifactIds. containsKey(subproject. name)) {
271+ artifactId = mappedArtifactIds[subproject. name]
272+ }
263273
264- scm {
265- url
= ' scm:[email protected] :grails/grails-core.git' 266- connection
= ' scm:[email protected] :grails/grails-core.git' 267- developerConnection
= ' scm:[email protected] :grails/grails-core.git' 268- }
274+ pom. withXml {
275+ def pomNode = asNode()
276+ pomNode. children(). last() + pomInfo
269277
270- developers {
271- developer {
272- id = ' graemerocher'
273- name = ' Graeme Rocher'
274- 275- }
276- }
278+ // dependency management shouldn't be included
279+ try { pomNode. dependencyManagement. replaceNode({}) } catch (Throwable ignore) {}
277280 }
281+
278282 if (subproject. name != ' grails-bom' ) {
279283 from components. java
280284 }
285+
286+ if (isAsyncProject) {
287+ versionMapping {
288+ usage(' java-api' ) { fromResolutionOf(' runtimeClasspath' ) }
289+ usage(' java-runtime' ) { fromResolutionResult() }
290+ }
291+ }
281292 }
282293 }
283294 }
@@ -301,10 +312,10 @@ subprojects { subproject ->
301312 }
302313 }
303314
304- if (subproject. name in [' grails-dependencies' , ' grails-bom' ]) return
315+ if (subproject. name in [' grails-dependencies' , ' grails-bom' ] || isExample ) return
305316
306317 dependencies {
307- api platform(project(' :grails-bom' ))
318+ implementation platform(project(' :grails-bom' ))
308319 }
309320
310321 if (subproject. name =~ / ^(grails-web|grails-plugin-|grails-test-suite|grails-test)/ ) {
0 commit comments