1- buildscript {
2- repositories {
3- maven { url " https://repo.grails.org/grails/core" }
4- maven { url " https://plugins.gradle.org/m2" }
5- }
6- dependencies {
7- classpath " org.grails:grails-gradle-plugin:$grailsGradlePluginVersion "
8- classpath " com.bertramlabs.plugins:asset-pipeline-gradle:3.3.4"
9- classpath " org.grails.plugins:hibernate5:7.2.0"
10- classpath " io.github.gradle-nexus:publish-plugin:1.0.0"
11- }
1+ plugins {
2+ id ' eclipse'
3+ id ' idea'
4+ id ' org.grails.grails-plugin'
5+ id ' com.bertramlabs.asset-pipeline'
6+ id ' org.grails.grails-gsp'
7+ id ' maven-publish'
8+ id ' signing'
129}
1310
14- group " io.github.gpc"
15-
16- apply plugin : " eclipse"
17- apply plugin : " idea"
18- apply plugin : " org.grails.grails-plugin"
19- apply plugin : " asset-pipeline"
20- apply plugin : " org.grails.grails-gsp"
21- apply plugin : " maven-publish"
22- apply plugin : " signing"
23- apply plugin : " io.github.gradle-nexus.publish-plugin"
11+ group = ' io.github.gpc'
2412
2513repositories {
26- maven { url " https://repo.grails.org/grails/core" }
14+ mavenCentral()
15+ maven { url ' https://repo.grails.org/grails/core' }
2716}
2817
2918configurations {
30- developmentOnly
31- runtimeClasspath {
32- extendsFrom developmentOnly
19+ configureEach {
20+ resolutionStrategy. force ' org.codehaus.groovy:groovy-xml:3.0.13'
3321 }
3422}
3523
3624dependencies {
3725
38- compileOnly " io.micronaut:micronaut-inject-groovy"
39-
40- implementation " org.grails:grails-logging"
41- implementation " org.grails:grails-plugin-rest"
42- implementation " org.grails:grails-plugin-databinding"
43- implementation " org.grails:grails-plugin-i18n"
44- implementation " org.grails:grails-plugin-services"
45- implementation " org.grails.plugins:async"
46- implementation " org.grails.plugins:scaffolding"
47- implementation " org.grails.plugins:hibernate5"
48- implementation " org.hibernate:hibernate-core:5.6.15.Final"
49- implementation " org.grails.plugins:gsp"
50- implementation " org.grails.plugins:mail:3.0.0"
26+ compileOnly ' io.micronaut:micronaut-inject-groovy'
27+
28+ implementation ' org.grails:grails-logging'
29+ implementation ' org.grails:grails-plugin-rest'
30+ implementation ' org.grails:grails-plugin-databinding'
31+ implementation ' org.grails:grails-plugin-i18n'
32+ implementation ' org.grails:grails-plugin-services'
33+ implementation ' org.grails.plugins:async'
34+ implementation ' org.grails.plugins:scaffolding'
35+ implementation ' org.grails.plugins:hibernate5'
36+ implementation ' org.hibernate:hibernate-core:5.6.15.Final'
37+ implementation ' org.grails.plugins:gsp'
38+ implementation ' org.grails.plugins:mail:3.0.0'
5139 // This is needed for the quartz-plugin on grails >= 4.0.x, https://github.com/grails-plugins/grails-quartz/issues/107#issuecomment-575951471
52- implementation(" org.quartz-scheduler:quartz:2.3.2" ) {
53- exclude group : ' slf4j-api' , module : ' c3p0'
54- }
55- implementation " org.grails.plugins:quartz:2.0.13"
56-
57- profile " org.grails.profiles:web-plugin"
58-
59- runtimeOnly " com.h2database:h2"
60- runtimeOnly " org.apache.tomcat:tomcat-jdbc"
61-
62- testImplementation " org.springframework.boot:spring-boot-starter-tomcat"
63- testImplementation " ch.qos.logback:logback-classic:1.2.12"
64- testImplementation " ch.qos.logback:logback-core:1.2.12"
65- testImplementation " io.micronaut:micronaut-inject-groovy"
66- testImplementation " org.grails:grails-gorm-testing-support"
67- testImplementation " org.grails:grails-web-testing-support"
68- }
69-
70- bootRun {
71- ignoreExitValue true
72- jvmArgs(
73- ' -Dspring.output.ansi.enabled=always' ,
74- ' -noverify' ,
75- ' -XX:TieredStopAtLevel=1' ,
76- ' -Xmx1024m' )
77- sourceResources sourceSets. main
78- String springProfilesActive = ' spring.profiles.active'
79- systemProperty springProfilesActive, System . getProperty(springProfilesActive)
40+ implementation(' org.quartz-scheduler:quartz:2.3.2' ) { exclude group : ' slf4j-api' , module : ' c3p0' }
41+ implementation ' org.grails.plugins:quartz:2.0.13'
42+
43+ testRuntimeOnly ' com.h2database:h2'
44+ testRuntimeOnly ' org.apache.tomcat:tomcat-jdbc'
45+
46+ testImplementation ' org.springframework.boot:spring-boot-starter-tomcat'
47+ // testImplementation "ch.qos.logback:logback-classic:1.2.12"
48+ // testImplementation "ch.qos.logback:logback-core:1.2.12"
49+ testImplementation ' io.micronaut:micronaut-inject-groovy'
50+ testImplementation ' org.grails:grails-gorm-testing-support'
51+ testImplementation ' org.grails:grails-web-testing-support'
8052}
8153
8254
83- tasks. withType(GroovyCompile ). configureEach {
84- configure(groovyOptions) {
85- forkOptions. jvmArgs = [' -Xmx1024m' ]
86- }
55+ java {
56+ sourceCompatibility = JavaVersion . VERSION_11
57+ targetCompatibility = JavaVersion . VERSION_11
58+ withSourcesJar()
59+ withJavadocJar()
8760}
8861
8962tasks. withType(Test ). configureEach {
@@ -194,7 +167,7 @@ ext."signing.keyId" = project.findProperty('signing.keyId') ?: System.getenv('SI
194167ext. " signing.password" = project. findProperty(' signing.password' ) ?: System . getenv(' SIGNING_PASSPHRASE' )
195168ext. " signing.secretKeyRingFile" = project. findProperty(' signing.secretKeyRingFile' ) ?: (System . getenv(' SIGNING_PASSPHRASE' ) ?: " ${ System.getProperty('user.home')} /.gnupg/secring.gpg" )
196169
197- ext. isReleaseVersion = ! version. endsWith(" SNAPSHOT" )
170+ ext. isReleaseVersion = ! version. toString() . endsWith(" SNAPSHOT" )
198171
199172afterEvaluate {
200173 signing {
@@ -207,25 +180,28 @@ tasks.withType(Sign).configureEach {
207180 onlyIf { isReleaseVersion }
208181}
209182
210- nexusPublishing {
211- repositories {
212- sonatype {
213- def ossUser = System . getenv(" SONATYPE_USERNAME" ) ?: project. findProperty(' sonatypeOss2Username' ) ?: ' '
214- def ossPass = System . getenv(" SONATYPE_PASSWORD" ) ?: project. findProperty(" sonatypeOss2Password" ) ?: ' '
215- def ossStagingProfileId = System . getenv(" SONATYPE_STAGING_PROFILE_ID" ) ?: project. findProperty(" sonatypeOssStagingProfileIdJms" ) ?: ' '
216-
217- nexusUrl = uri(" https://s01.oss.sonatype.org/service/local/" )
218- snapshotRepositoryUrl = uri(" https://s01.oss.sonatype.org/content/repositories/snapshots/" )
219- username = ossUser
220- password = ossPass
221- stagingProfileId = ossStagingProfileId
183+ if (project. hasProperty(' release' )) {
184+ apply plugin : ' io.github.gradle-nexus.publish-plugin'
185+ nexusPublishing {
186+ repositories {
187+ sonatype {
188+ def ossUser = System . getenv(" SONATYPE_USERNAME" ) ?: project. findProperty(' sonatypeOss2Username' ) ?: ' '
189+ def ossPass = System . getenv(" SONATYPE_PASSWORD" ) ?: project. findProperty(" sonatypeOss2Password" ) ?: ' '
190+ def ossStagingProfileId = System . getenv(" SONATYPE_STAGING_PROFILE_ID" ) ?: project. findProperty(" sonatypeOssStagingProfileIdJms" ) ?: ' '
191+
192+ nexusUrl = uri(" https://s01.oss.sonatype.org/service/local/" )
193+ snapshotRepositoryUrl = uri(" https://s01.oss.sonatype.org/content/repositories/snapshots/" )
194+ username = ossUser
195+ password = ossPass
196+ stagingProfileId = ossStagingProfileId
197+ }
222198 }
223199 }
224200}
225201
226202tasks. register(' snapshotVersion' ) {
227203 doLast {
228- if (! project. version. endsWith(' -SNAPSHOT' )) {
204+ if (! project. version. toString() . endsWith(' -SNAPSHOT' )) {
229205 ant. propertyfile(file : " gradle.properties" ) {
230206 entry(key : " version" , value : " ${ project.version} -SNAPSHOT" )
231207 }
0 commit comments