1-
21// //////////////////////////////////////////////////////////////////////////////////////////
32// This file is generated by Speakeasy and any edits will be lost in generation updates.
43//
98// of string where each string value is an additional line in the block) in gen.yaml.
109// //////////////////////////////////////////////////////////////////////////////////////////
1110
11+
1212plugins {
1313 // Apply the java-library plugin for API and implementation separation.
1414 id ' java-library'
1515 id ' maven-publish'
1616 id ' signing'
17+ // V2 publishing plugin (Sonatype Central Portal)
1718 id ' cl.franciscosolis.sonatype-central-upload' version ' 1.0.3'
19+ id " io.spring.dependency-management" version " 1.1.6" apply false
1820}
1921
2022compileJava. options. encoding = " UTF-8"
@@ -31,21 +33,18 @@ java {
3133 withJavadocJar()
3234}
3335
34- model {
35- tasks. generatePomFileForMavenPublication {
36- destination = file(" $buildDir /pom.xml" )
37- }
38- }
39-
4036version = " ${ version} "
4137group = " ${ groupId} "
4238
4339jar {
44- dependsOn( " : generatePomFileForMavenPublication" )
40+ dependsOn ' generatePomFileForMavenPublication'
4541 archiveBaseName = " ${ artifactId} "
4642
4743 into(" META-INF/maven/com.stackone/stackone-client-java" ) {
48- from(" $buildDir /pom.xml" )
44+ from(layout. buildDirectory. file(" pom.xml" )) {
45+ // Only include if it exists to avoid build ordering issues
46+ duplicatesStrategy = DuplicatesStrategy . INCLUDE
47+ }
4948 }
5049}
5150
@@ -58,7 +57,7 @@ javadoc {
5857 options. addStringOption(' Xdoclint:none' , ' -quiet' )
5958}
6059
61- tasks. withType(Javadoc ) {
60+ tasks. withType(Javadoc ). configureEach {
6261 failOnError = false
6362 options. addStringOption(' Xdoclint:none' , ' -quiet' )
6463}
@@ -74,85 +73,6 @@ sourcesJar {
7473javadocJar {
7574 archiveBaseName = " ${ artifactId} "
7675}
77- sonatypeCentralUpload {
78- // This is your Sonatype generated username
79- username = System . getenv(" SONATYPE_USERNAME" )
80- // This is your sonatype generated password
81- password = System . getenv(" SONATYPE_PASSWORD" )
82-
83- // This is a list of files to upload. Ideally you would point to your jar file, source and javadoc jar (required by central)
84- archives = files(
85- " $buildDir /libs/${ artifactId} -${ version} .jar" ,
86- " $buildDir /libs/${ artifactId} -${ version} -sources.jar" ,
87- " $buildDir /libs/${ artifactId} -${ version} -javadoc.jar"
88- )
89-
90- // This is the pom file to upload. This is required by central
91- pom = file(" $buildDir /pom.xml" )
92-
93- // This is your PGP private key. This is required to sign your files
94- signingKey = System . getenv(" SONATYPE_SIGNING_KEY" )
95- // This is your PGP private key passphrase to decrypt your private key
96- signingKeyPassphrase = System . getenv(" SIGNING_KEY_PASSPHRASE" )
97- }
98-
99-
100- publishing {
101-
102- publications {
103- maven(MavenPublication ) {
104- // note that properties can't yet be used below!
105- // https://github.com/gradle/gradle/issues/18619
106- groupId = " com.stackone"
107- artifactId = " stackone-client-java"
108- version = " 0.13.0"
109-
110- from components. java
111-
112- pom {
113- properties = [
114- ' maven.compiler.source' : ' 11' ,
115- ' maven.compiler.target' : ' 11' ,
116- ]
117- name = ' StackOne Java SDK'
118- description = ' SDK enabling Java developers to easily integrate with the StackOne API.'
119- url = ' https://github.com/owner/repo'
120- scm {
121- url = ' github.com/owner/repo'
122- connection = ' scm:git:ssh://git@github.com/owner/repo.git'
123- }
124- licenses {
125- license {
126- name = ' The MIT License (MIT)'
127- url = ' https://mit-license.org/'
128- }
129- }
130- developers {
131- developer {
132- name = ' StackOne'
133- organization = ' StackOne'
134- email = ' contact@stackone.com'
135- }
136- }
137- organization {
138- name = ' StackOne'
139- url = ' www.stackone.com'
140- }
141- }
142- }
143- }
144- }
145-
146- if (! project. hasProperty(' skip.signing' )) {
147- signing {
148- def signingKey = findProperty(" signingKey" )
149- def signingPassphrase = findProperty(" signingPassphrase" )
150- useInMemoryPgpKeys(signingKey, signingPassphrase)
151- sign publishing. publications. maven
152- }
153- }
154-
155-
15676
15777dependencies {
15878 api ' com.fasterxml.jackson.core:jackson-annotations:2.18.2'
@@ -165,4 +85,58 @@ dependencies {
16585 api ' org.reactivestreams:reactive-streams:1.0.4'
16686}
16787
88+ ext {
89+ springBootVersion = ' 2.7.18'
90+ }
91+
92+ subprojects {
93+ if (name in [
94+ ' stackone-client-java-spring-boot-autoconfigure' ,
95+ ' stackone-client-java-spring-boot-starter'
96+ ]) {
97+ // Ensure subprojects use the same group and version as root project
98+ group = rootProject. group
99+ version = rootProject. version
100+
101+ apply {
102+ plugin " java-library"
103+ plugin " io.spring.dependency-management"
104+ plugin " maven-publish"
105+ plugin " signing"
106+ plugin " cl.franciscosolis.sonatype-central-upload"
107+ }
108+ dependencyManagement {
109+ imports {
110+ mavenBom " org.springframework.boot:spring-boot-dependencies:${ rootProject.springBootVersion} "
111+ }
112+ }
113+ repositories {
114+ mavenCentral()
115+ }
116+ java {
117+ withSourcesJar()
118+ withJavadocJar()
119+ }
120+ tasks. withType(JavaCompile ). configureEach {
121+ options. release = 11
122+ }
123+
124+ // Apply publishing configuration to all subprojects - they'll check for publishingConfig internally
125+ apply from : rootProject. file(' publishing.gradle' )
126+ }
127+ }
128+
129+ ext {
130+ publishingConfig = [
131+ groupId : group,
132+ artifactId : artifactId,
133+ version : version,
134+ name : " StackOne Java SDK" ,
135+ description : " SDK enabling Java developers to easily integrate with the StackOne API." ,
136+ publicationName : " maven"
137+ ]
138+ }
139+
140+ apply from : ' publishing.gradle'
141+
168142apply from : ' build-extras.gradle'
0 commit comments