@@ -16,188 +16,50 @@ buildscript {
1616 }
1717 }
1818 dependencies {
19- classpath " org.graceframework:grace-gradle-plugin:$graceVersion "
20- classpath " io.github.gradle-nexus:publish-plugin:2.0.0"
19+ classpath " org.graceframework:grace-gradle-plugin:${ libs.versions.grace.framework.get()} "
2120 }
2221}
2322
24- logger. lifecycle " GORM VERSION = ${ project.datastoreVersion} "
23+ plugins {
24+ id ' java-library'
25+ id ' groovy'
26+ id ' maven-publish'
27+ id ' signing'
28+ id ' eclipse'
29+ id ' idea'
30+ // alias libs.plugins.grace.doc
31+ alias libs. plugins. gradle. nexus. publish
32+ }
2533
26- group = " org.graceframework"
27- version = project. projectVersion
34+ apply plugin : ' org.graceframework.grace-doc'
2835
2936ext {
3037 isCiBuild = project. hasProperty(" isCiBuild" ) || System . getenv(). get(" CI" ) as Boolean
3138 isBuildSnapshot = project. version. endsWith(" -SNAPSHOT" )
3239 isReleaseVersion = ! isBuildSnapshot
3340}
3441
35- ext. " signing.keyId" = System . getenv(" SIGNING_KEY" ) ?: project. hasProperty(" signing.keyId" ) ? project. getProperty(' signing.keyId' ) : null
36- ext. " signing.password" = System . getenv(" SIGNING_PASSPHRASE" ) ?: project. hasProperty(" signing.password" ) ? project. getProperty(' signing.password' ) : null
37- ext. " signing.secretKeyRingFile" = project. hasProperty(" signing.secretKeyRingFile" ) ? project. getProperty(' signing.secretKeyRingFile' ) : null
42+ ext. " signing.keyId" = project. hasProperty(" signing.keyId" ) ? project. getProperty(' signing.keyId' ) : System . getenv(' SIGNING_KEY' )
43+ ext. " signing.password" = project. hasProperty(" signing.password" ) ? project. getProperty(' signing.password' ) : System . getenv(' SIGNING_PASSPHRASE' )
44+ ext. " signing.secretKeyRingFile" = project. hasProperty(" signing.secretKeyRingFile" ) ? project. getProperty(' signing.secretKeyRingFile' ) : (" ${ System.properties['user.home']}${ File.separator} .gnupg${ File.separator} secring.gpg" )
45+ ext. isReleaseVersion = ! projectVersion. endsWith(" SNAPSHOT" )
3846
39- apply plugin : ' groovy'
40- apply plugin : ' maven-publish'
41- apply plugin : " io.github.gradle-nexus.publish-plugin"
42- apply plugin : ' org.graceframework.grace-doc'
47+ version = project. projectVersion
48+ group = " org.graceframework"
4349
44- nexusPublishing {
45- repositories {
46- sonatype {
47- def mavenUser = System . getenv(" MAVEN_CENTRAL_USER" ) ?: project. hasProperty(" mavenCentralUsername" ) ? project. mavenCentralUsername : ' '
48- def mavenPass = System . getenv(" MAVEN_CENTRAL_PASSWORD" ) ?: project. hasProperty(" mavenCentralPassword" ) ? project. mavenCentralPassword : ' '
49- nexusUrl = uri(" https://ossrh-staging-api.central.sonatype.com/service/local/" )
50- snapshotRepositoryUrl = uri(" https://central.sonatype.com/repository/maven-snapshots/" )
51- username = mavenUser
52- password = mavenPass
53- }
54- }
50+ repositories {
51+ mavenCentral()
5552}
5653
57- allprojects {
58- ext {
59- groovyVersion = System . getenv(' CI_GROOVY_VERSION' ) ?: project. groovyVersion
60- }
61-
62- repositories {
63- mavenCentral()
64- maven {
65- name = ' Maven Central Portal Snapshots'
66- url = ' https://central.sonatype.com/repository/maven-snapshots/'
67-
68- content {
69- includeGroupAndSubgroups ' org.graceframework'
70- }
71- mavenContent {
72- snapshotsOnly()
73- }
74- }
75- }
76-
77- configurations {
78- documentation
79- }
80-
81- dependencies {
82- documentation " com.github.javaparser:javaparser-core:$javaParserCoreVersion "
83- documentation " org.apache.groovy:groovy:$groovyVersion "
84- documentation " org.apache.groovy:groovy-ant:$groovyVersion "
85- }
54+ configurations {
55+ documentation
8656}
8757
88- subprojects { project ->
89- if (project. name == ' docs' ) {
90- return
91- }
92-
93- apply plugin : ' groovy'
94- apply plugin : " java-library"
95- apply plugin : ' maven-publish'
96- apply plugin : ' signing'
97- apply plugin : " io.spring.dependency-management"
98-
99- sourceCompatibility = " 17"
100- targetCompatibility = " 17"
101-
102- java {
103- withJavadocJar()
104- withSourcesJar()
105- }
106-
107- dependencyManagement {
108- imports {
109- mavenBom " org.graceframework:grace-bom:$graceVersion "
110- }
111- applyMavenExclusions false
112- generatedPomCustomization {
113- enabled = false
114- }
115- }
116-
117- dependencies {
118- api " org.apache.groovy:groovy"
119-
120- testImplementation " org.apache.groovy:groovy-json"
121- testImplementation " org.apache.groovy:groovy-templates"
122- testImplementation " org.apache.groovy:groovy-test-junit5" , {
123- exclude group : " org.junit.platform" , module : " junit-platform-launcher"
124- exclude group : " org.junit.jupiter" , module : " junit-jupiter-engine"
125- }
126- testImplementation " org.spockframework:spock-core" , {
127- exclude group : " org.junit.platform" , module : " junit-platform-engine"
128- }
129- testImplementation " org.junit.jupiter:junit-jupiter-api"
130- testImplementation " org.junit.platform:junit-platform-runner"
131- testRuntimeOnly " org.junit.jupiter:junit-jupiter-engine"
132- }
133-
134- publishing {
135- publications {
136- maven(MavenPublication ) {
137- def projectArtifactId = project. name
138- def projectName = project. name. split(' -' )* . capitalize(). join(' ' )
139-
140- artifactId projectArtifactId
141- from components. java
142-
143- versionMapping {
144- usage(' java-api' ) {
145- fromResolutionOf(' runtimeClasspath' )
146- }
147- usage(' java-runtime' ) {
148- fromResolutionResult()
149- }
150- }
151-
152- pom {
153- name = projectName
154- description = " Grace Data : $projectName "
155- url = ' https://github.com/graceframework/grace-data-mongodb'
156-
157- licenses {
158- license {
159- name = ' The Apache Software License, Version 2.0'
160- url = ' https://www.apache.org/licenses/LICENSE-2.0.txt'
161- distribution = ' repo'
162- }
163- }
164-
165- scm {
166- url = ' https://github.com/graceframework/grace-data-mongodb'
167- connection
= ' scm:[email protected] :graceframework/grace-data-mongodb.git' 168- developerConnection
= ' scm:[email protected] :graceframework/grace-data-mongodb.git' 169- }
170-
171- developers {
172- developer {
173- id = ' rainboyan'
174- name = ' Michael Yan'
175- 176- }
177- }
178- }
179- }
180- }
181- }
182-
183- afterEvaluate {
184- signing {
185- required { isReleaseVersion }
186- sign publishing. publications. maven
187- }
188- }
189-
190- tasks. withType(Sign ) {
191- onlyIf { isReleaseVersion }
192- }
193-
194- // do not generate extra load on Nexus with new staging repository if signing fails
195- tasks. withType(io.github.gradlenexus.publishplugin.InitializeNexusStagingRepository ). configureEach {
196- shouldRunAfter(tasks. withType(Sign ))
197- }
58+ dependencies {
59+ documentation libs. javaparser
60+ documentation libs. groovy. core
19861}
19962
200-
20163def cleanTask = project. tasks. findByName(' clean' )
20264if (cleanTask == null ) {
20365 task clean(type : Delete ) {
@@ -240,3 +102,16 @@ publishGuide {
240102task docs {
241103 dependsOn groovydoc, publishGuide
242104}
105+
106+ nexusPublishing {
107+ repositories {
108+ sonatype {
109+ def mavenUser = System . getenv(" MAVEN_CENTRAL_USER" ) ?: project. hasProperty(" mavenCentralUsername" ) ? project. mavenCentralUsername : ' '
110+ def mavenPass = System . getenv(" MAVEN_CENTRAL_PASSWORD" ) ?: project. hasProperty(" mavenCentralPassword" ) ? project. mavenCentralPassword : ' '
111+ nexusUrl = uri(" https://ossrh-staging-api.central.sonatype.com/service/local/" )
112+ snapshotRepositoryUrl = uri(" https://central.sonatype.com/repository/maven-snapshots/" )
113+ username = mavenUser
114+ password = mavenPass
115+ }
116+ }
117+ }
0 commit comments