11buildscript {
22 repositories {
3+ // mavenLocal()
34 mavenCentral()
45 gradlePluginPortal()
56 }
67 dependencies {
78 classpath " org.graceframework:grace-gradle-plugin:$graceVersion "
9+ // classpath "org.graceframework.plugins:asset-pipeline-gradle:$assetPipelineVersion"
810 classpath ' org.asciidoctor:asciidoctor-gradle-jvm:4.0.3'
911 classpath " com.github.erdi:webdriver-binaries-gradle-plugin:$webdriverBinariesVersion "
1012 classpath " org.graceframework.plugins:views-gradle:6.3.0-M1"
@@ -18,7 +20,6 @@ group = "org.graceframework"
1820version = project. projectVersion
1921
2022ext {
21- hibernatePluginVersion = project. hibernatePluginVersion
2223 isCiBuild = project. hasProperty(" isCiBuild" ) || System . getenv(). get(" CI" ) as Boolean
2324 isBuildSnapshot = project. version. endsWith(" -SNAPSHOT" )
2425 isReleaseVersion = ! isBuildSnapshot
3031ext. " signing.keyId" = System . getenv(" SIGNING_KEY" ) ?: project. hasProperty(" signing.keyId" ) ? project. getProperty(' signing.keyId' ) : null
3132ext. " signing.password" = System . getenv(" SIGNING_PASSPHRASE" ) ?: project. hasProperty(" signing.password" ) ? project. getProperty(' signing.password' ) : null
3233ext. " signing.secretKeyRingFile" = project. hasProperty(" signing.secretKeyRingFile" ) ? project. getProperty(' signing.secretKeyRingFile' ) : null
33- ext[' junit-jupiter.version' ] = junitJupiterVersion
3434
3535apply plugin : ' maven-publish'
3636apply plugin : " io.github.gradle-nexus.publish-plugin"
@@ -67,21 +67,17 @@ subprojects { project ->
6767 }
6868 }
6969
70- ext[' h2.version' ] = h2Version
71- ext[' gorm.version' ] = datastoreVersion
72- ext[' gorm.hibernate5.version' ] = hibernatePluginVersion
73- ext[' junit-jupiter.version' ] = junitJupiterVersion
74- ext[' spock.version' ] = spockVersion
75- ext[' mongodb.version' ] = mongodbDriverVersion
76-
7770 if (project. name. startsWith(" examples" )) {
71+ group = " examples"
7872
7973 apply plugin : ' groovy'
8074
81- if (project. name. contains(' grace' )) {
82-
75+ if (project. name. contains(' grace' )) {
8376 apply plugin :" org.graceframework.grace-web"
8477 apply plugin :" org.graceframework.grace-gsp"
78+ // Execution failed for task ':examples-grace-hibernate5-mongodb:assetCompile'.
79+ // > java.util.concurrent.ExecutionException: java.lang.NoSuchMethodError: 'void groovy.lang.IntRange.<init>(boolean, boolean, int, int)'
80+ // apply plugin: "org.graceframework.asset-pipeline"
8581 }
8682
8783 boolean usesGeb = project. name. contains(' grace-hibernate5-mongodb' ) || project. name. contains(' grace-mongodb' ) || project. name. contains(' grace-mongodb-database-per-tenant' )|| project. name. contains(' grace-rxmongodb' )
@@ -90,18 +86,33 @@ subprojects { project ->
9086 apply plugin :" com.github.erdi.webdriver-binaries"
9187 }
9288
93- if (project. name == " examples-test-data-service" ) {
89+ if (project. name == " examples-grace- test-data-service" ) {
9490 apply plugin :" org.graceframework.grace-web"
9591 apply plugin :" org.graceframework.plugins.views-json"
9692 }
9793
94+ if (project. name == " examples-springboot-mongodb" ) {
95+ apply plugin : ' org.springframework.boot'
96+ apply plugin : ' io.spring.dependency-management'
97+
98+ dependencyManagement {
99+ imports {
100+ mavenBom " org.graceframework:grace-bom:$graceVersion "
101+ }
102+ applyMavenExclusions false
103+ generatedPomCustomization {
104+ enabled = false
105+ }
106+ }
107+ }
108+
98109 dependencies {
99- testImplementation " org.hibernate:hibernate-validator: $h ibernateValidatorVersion "
100- testImplementation " org.apache.groovy:groovy-test-junit5: $g roovyVersion "
101- testImplementation " org.spockframework:spock-core: $s pockVersion " , { transitive = false }
102- testImplementation " org.junit.jupiter:junit-jupiter-api: $j unitJupiterVersion "
103- testImplementation " org.junit.platform:junit-platform-runner:1.10.2 "
104- testRuntimeOnly " org.junit.jupiter:junit-jupiter-engine: $j unitJupiterVersion "
110+ testImplementation " org.hibernate.validator :hibernate-validator"
111+ testImplementation " org.apache.groovy:groovy-test-junit5"
112+ testImplementation " org.spockframework:spock-core" , { transitive = false }
113+ testImplementation " org.junit.jupiter:junit-jupiter-api"
114+ testImplementation " org.junit.platform:junit-platform-runner"
115+ testRuntimeOnly " org.junit.jupiter:junit-jupiter-engine"
105116 }
106117
107118 tasks. withType(Test ) {
@@ -120,11 +131,6 @@ subprojects { project ->
120131 }
121132
122133 boolean isPluginProject = project. name. startsWith(" grace" ) && project. name. endsWith(" -plugin" )
123- boolean isGracePluginProject = project. name. endsWith(" -plugin" )
124-
125- ext {
126- projectInfo = new PublishingConvention (project)
127- }
128134
129135 apply plugin : ' groovy'
130136
@@ -133,11 +139,22 @@ subprojects { project ->
133139 version = rootProject. version
134140
135141 apply plugin : " org.graceframework.grace-plugin"
136- } else {
142+ }
143+ else {
137144 group = " org.graceframework"
138145 version = rootProject. version
139146
140- apply plugin : " groovy"
147+ apply plugin : " io.spring.dependency-management"
148+
149+ dependencyManagement {
150+ imports {
151+ mavenBom " org.graceframework:grace-bom:$graceVersion "
152+ }
153+ applyMavenExclusions false
154+ generatedPomCustomization {
155+ enabled = false
156+ }
157+ }
141158 }
142159
143160 if (project. name == ' docs' ) {
@@ -156,43 +173,50 @@ subprojects { project ->
156173 withSourcesJar()
157174 }
158175
159- configurations {
160- all {
161- resolutionStrategy {
162- force " org.apache.groovy:groovy:$groovyVersion "
163- force " org.apache.groovy:groovy-dateutil:$groovyVersion "
164- force " org.apache.groovy:groovy-xml:$groovyVersion "
165- force " org.apache.groovy:groovy-templates:$groovyVersion "
166- }
167- }
168- }
169-
170176 dependencies {
171- api " org.apache.groovy:groovy: $g roovyVersion "
172- api " org.apache.groovy:groovy-templates: $g roovyVersion "
177+ api " org.apache.groovy:groovy"
178+ api " org.apache.groovy:groovy-templates"
173179
174- testImplementation " org.apache.groovy:groovy-json: $g roovyVersion "
175- testImplementation " org.apache.groovy:groovy-templates: $g roovyVersion "
176- testImplementation " org.apache.groovy:groovy-test-junit5: $g roovyVersion " , {
180+ testImplementation " org.apache.groovy:groovy-json"
181+ testImplementation " org.apache.groovy:groovy-templates"
182+ testImplementation " org.apache.groovy:groovy-test-junit5" , {
177183 exclude group : " org.junit.platform" , module : " junit-platform-launcher"
178184 exclude group : " org.junit.jupiter" , module : " junit-jupiter-engine"
179185 }
180- testImplementation " org.spockframework:spock-core: $s pockVersion " , {
186+ testImplementation " org.spockframework:spock-core" , {
181187 exclude group : " org.junit.platform" , module : " junit-platform-engine"
182188 }
183- testImplementation " org.junit.jupiter:junit-jupiter-api: $j unitJupiterVersion "
184- testImplementation " org.junit.platform:junit-platform-runner: $j unitPlatformVersion "
185- testRuntimeOnly " org.junit.jupiter:junit-jupiter-engine: $j unitJupiterVersion "
189+ testImplementation " org.junit.jupiter:junit-jupiter-api"
190+ testImplementation " org.junit.platform:junit-platform-runner"
191+ testRuntimeOnly " org.junit.jupiter:junit-jupiter-engine"
186192 }
187193
188194 publishing {
189195 publications {
190196 maven(MavenPublication ) {
197+ def projectArtifactId = project. name
198+ def projectName = project. name. split(' -' )* . capitalize(). join(' ' )
199+ if (project. name == ' grace-plugin' ) {
200+ projectArtifactId = ' mongodb'
201+ projectName = ' Grace MongoDb Plugin'
202+ }
203+
204+ artifactId projectArtifactId
205+ from components. java
206+
207+ versionMapping {
208+ usage(' java-api' ) {
209+ fromResolutionOf(' runtimeClasspath' )
210+ }
211+ usage(' java-runtime' ) {
212+ fromResolutionResult()
213+ }
214+ }
191215
192216 pom {
193- name = projectInfo . projectName
194- description = projectInfo . projectDescription
195- url = projectInfo . projectURL
217+ name = projectName
218+ description = " Grace Data : $p rojectName "
219+ url = ' https://github.com/graceframework/grace-data-mongodb '
196220
197221 licenses {
198222 license {
@@ -203,7 +227,7 @@ subprojects { project ->
203227 }
204228
205229 scm {
206- url = ' scm:git@ github.com: graceframework/grace-data-mongodb.git '
230+ url = ' https:// github.com/ graceframework/grace-data-mongodb'
207231 connection
= ' scm:[email protected] :graceframework/grace-data-mongodb.git' 208232 developerConnection
= ' scm:[email protected] :graceframework/grace-data-mongodb.git' 209233 }
@@ -217,11 +241,8 @@ subprojects { project ->
217241 }
218242 }
219243
220- artifactId projectInfo. projectArtifactId
221- from components. java
222-
223244 afterEvaluate {
224- if (isGracePluginProject ) {
245+ if (isPluginProject ) {
225246 artifact source :" ${ sourceSets.main.groovy.classesDirectory.get()} /META-INF/grails-plugin.xml" ,
226247 classifier :" plugin" ,
227248 extension :' xml'
@@ -248,24 +269,3 @@ subprojects { project ->
248269 shouldRunAfter(tasks. withType(Sign ))
249270 }
250271}
251-
252- class PublishingConvention {
253- Project project
254-
255- String projectArtifactId
256- String projectName = ' Grace Data MongoDB'
257- String projectDescription = ' Provides a GORM Object Mapping implementations for the MongodB Document Database'
258- String projectURL = ' https://github.com/graceframework/grace-data-mongodb'
259- String projectIssueTrackerUrl = ' https://github.com/graceframework/grace-data-mongodb/issues'
260- String projectVcsUrl = ' https://github.com/graceframework/grace-data-mongodb'
261-
262- PublishingConvention (Project project ) {
263- this . project = project
264-
265- def name = project. name
266- if (name. startsWith(' grace' ) && name. endsWith(' -plugin' )) {
267- name = ' mongodb'
268- }
269- projectArtifactId = name
270- }
271- }
0 commit comments