1- buildscript {
2- repositories {
3- mavenCentral()
4- gradlePluginPortal()
5- if (project. projectVersion. endsWith(' -SNAPSHOT' )) {
6- maven {
7- name = ' Maven Central Portal Snapshots'
8- url = ' https://central.sonatype.com/repository/maven-snapshots/'
9-
10- content {
11- includeGroupAndSubgroups ' org.graceframework'
12- }
13- mavenContent {
14- snapshotsOnly()
15- }
16- }
17- }
18- }
19- dependencies {
20- classpath " io.github.gradle-nexus:publish-plugin:2.0.0"
21- classpath " org.graceframework:grace-gradle-plugin:$graceVersion "
22- classpath " io.spring.gradle:dependency-management-plugin:$dependencyManagementPluginVersion "
23- }
1+ plugins {
2+ id ' java-library'
3+ id ' groovy'
4+ id ' maven-publish'
5+ id ' signing'
6+ id ' eclipse'
7+ id ' idea'
8+ alias libs. plugins. grace. doc
9+ alias libs. plugins. gradle. nexus. publish
2410}
2511
2612ext. " signing.keyId" = project. hasProperty(" signing.keyId" ) ? project. getProperty(' signing.keyId' ) : System . getenv(' SIGNING_KEY' )
@@ -31,180 +17,8 @@ ext.isReleaseVersion = !projectVersion.endsWith("SNAPSHOT")
3117version = project. projectVersion
3218group = " org.graceframework"
3319
34- apply plugin : " groovy"
35- apply plugin : " java-library"
36- apply plugin : " io.github.gradle-nexus.publish-plugin"
37- apply plugin : " maven-publish"
38- apply plugin : " signing"
39- apply plugin : " idea"
40- apply plugin : ' org.graceframework.grace-doc'
41-
42- allprojects {
43- repositories {
44- mavenCentral()
45- if (project. projectVersion. endsWith(' -SNAPSHOT' )) {
46- maven {
47- name = ' Maven Central Portal Snapshots'
48- url = ' https://central.sonatype.com/repository/maven-snapshots/'
49-
50- content {
51- includeGroupAndSubgroups ' org.graceframework'
52- }
53- mavenContent {
54- snapshotsOnly()
55- }
56- }
57- }
58- }
59-
60- configurations {
61- documentation
62- }
63- }
64-
65- subprojects {
66- version = project. projectVersion
67- group = " org.graceframework"
68-
69- apply plugin : " groovy"
70- apply plugin : " eclipse"
71- apply plugin : " idea"
72- apply plugin : " java-library"
73- apply plugin : " maven-publish"
74- apply plugin : " signing"
75- apply plugin : " checkstyle"
76- apply plugin : " codenarc"
77- apply plugin : " io.spring.dependency-management"
78-
79- dependencyManagement {
80- imports {
81- mavenBom " org.graceframework:grace-bom:$graceVersion "
82- }
83- applyMavenExclusions false
84- generatedPomCustomization {
85- enabled = false
86- }
87- }
88-
89- dependencies {
90- api " org.apache.groovy:groovy"
91- testImplementation " org.apache.groovy:groovy-test-junit5"
92- testImplementation " org.junit.jupiter:junit-jupiter-api"
93- testImplementation " org.junit.jupiter:junit-jupiter-engine"
94- testImplementation " org.junit.platform:junit-platform-runner"
95- testImplementation(" org.spockframework:spock-core" ) { transitive = false }
96-
97- if (project. name == " grace-datastore-gorm-tck" ) {
98- api " org.apache.groovy:groovy-test-junit5"
99- api " org.junit.jupiter:junit-jupiter-api"
100- api " org.junit.platform:junit-platform-runner"
101- runtimeOnly " org.junit.jupiter:junit-jupiter-engine"
102- implementation(" org.spockframework:spock-core" ) { transitive = false }
103- }
104- }
105-
106- if (project. name == " grace-datastore-gorm-async" ) {
107- dependencies {
108- testImplementation project(" :grace-datastore-gorm-tck" )
109- }
110- }
111-
112- compileTestGroovy {
113- configure(groovyOptions. forkOptions) {
114- jvmArgs = [ ' -Xmx768m' ]
115- }
116- }
117-
118- java {
119- toolchain {
120- languageVersion = JavaLanguageVersion . of(17 )
121- }
122- withJavadocJar()
123- withSourcesJar()
124- }
125-
126- javadoc {
127- failOnError = false
128- }
129-
130- test {
131- useJUnitPlatform()
132- }
133-
134- checkstyle {
135- toolVersion = " 10.3.2"
136- configDirectory. set(rootProject. file(" $rootDir /gradle/checkstyle" ))
137- }
138-
139- codenarc {
140- toolVersion = ' 3.1.0'
141- setConfigFile(new File (" $rootDir /gradle/codenarc/codenarc.groovy" ))
142- }
143-
144- configure([javadoc]) {
145- options. encoding " UTF-8"
146- options. docEncoding " UTF-8"
147- options. charSet " UTF-8"
148- options. jFlags " -Xms64M" , " -Xmx512M"
149- }
150-
151- publishing {
152- publications {
153- maven(MavenPublication ) {
154- def projectName = project. name. split(' -' )* . capitalize(). join(' ' )
155- groupId = project. group
156- version = project. version
157-
158- versionMapping {
159- usage(' java-api' ) {
160- fromResolutionOf(' runtimeClasspath' )
161- }
162- usage(' java-runtime' ) {
163- fromResolutionResult()
164- }
165- }
166-
167- from components. java
168-
169- pom {
170- name = projectName
171- description = " Grace Data : $projectName "
172- url = ' https://github.com/graceframework/grace-data'
173- licenses {
174- license {
175- name = ' The Apache License, Version 2.0'
176- url = ' https://www.apache.org/licenses/LICENSE-2.0.txt'
177- }
178- }
179- developers {
180- developer {
181- id = ' rainboyan'
182- name = ' Michael Yan'
183- 184- }
185- }
186- scm {
187- connection = ' scm:git:git://github.com/graceframework/grace-data.git'
188- developerConnection = ' scm:git:ssh://github.com:graceframework/grace-data.git'
189- url = ' https://github.com/graceframework/grace-data/'
190- }
191- }
192- }
193- }
194- }
195-
196- afterEvaluate {
197- signing {
198- required = isReleaseVersion && gradle. taskGraph. hasTask(" publish" )
199- sign publishing. publications. maven
200- }
201- }
202- }
203-
204- dependencies {
205- documentation " com.github.javaparser:javaparser-core:$javaParserCoreVersion "
206- documentation " org.apache.groovy:groovy:$groovyVersion "
207- documentation " org.apache.groovy:groovy-ant:$groovyVersion "
20+ configurations {
21+ documentation
20822}
20923
21024def cleanTask = project. tasks. findByName(' clean' )
@@ -246,16 +60,58 @@ docs {
24660 sourceDir = project. file(' src/docs' )
24761}
24862
249- project. afterEvaluate {
250- allprojects. repositories. each { handler ->
251- handler. each {
252- if (it. url. toString(). startsWith(" http://" )) {
253- throw new RuntimeException (" Build should not define insecure HTTP-based Maven repostories" )
63+ publishing {
64+ publications {
65+ maven(MavenPublication ) {
66+ def projectName = project. name. split(' -' )* . capitalize(). join(' ' )
67+ groupId = project. group
68+ version = project. version
69+
70+ versionMapping {
71+ usage(' java-api' ) {
72+ fromResolutionOf(' runtimeClasspath' )
73+ }
74+ usage(' java-runtime' ) {
75+ fromResolutionResult()
76+ }
77+ }
78+
79+ from components. java
80+
81+ pom {
82+ name = projectName
83+ description = " Grace Data : $projectName "
84+ url = ' https://github.com/graceframework/grace-data'
85+ licenses {
86+ license {
87+ name = ' The Apache License, Version 2.0'
88+ url = ' https://www.apache.org/licenses/LICENSE-2.0.txt'
89+ }
90+ }
91+ developers {
92+ developer {
93+ id = ' rainboyan'
94+ name = ' Michael Yan'
95+ 96+ }
97+ }
98+ scm {
99+ connection = ' scm:git:git://github.com/graceframework/grace-data.git'
100+ developerConnection = ' scm:git:ssh://github.com:graceframework/grace-data.git'
101+ url = ' https://github.com/graceframework/grace-data/'
102+ }
254103 }
255104 }
256105 }
257106}
258107
108+ afterEvaluate {
109+ signing {
110+ required = isReleaseVersion && gradle. taskGraph. hasTask(" publish" )
111+ sign publishing. publications. maven
112+ }
113+ }
114+
259115nexusPublishing {
260116 repositories {
261117 sonatype {
0 commit comments