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"
3335
3436model {
3537 tasks. generatePomFileForMavenPublication {
36- destination = file(" $b uildDir / pom.xml" )
38+ destination = file(layout . buildDirectory . file( " pom.xml" ) )
3739 }
3840}
3941
4547 archiveBaseName = " ${ artifactId} "
4648
4749 into(" META-INF/maven/com.apideck/unify" ) {
48- from(" $b uildDir / pom.xml" )
50+ from(layout . buildDirectory . file( " pom.xml" ) )
4951 }
5052}
5153
@@ -58,7 +60,7 @@ javadoc {
5860 options. addStringOption(' Xdoclint:none' , ' -quiet' )
5961}
6062
61- tasks. withType(Javadoc ) {
63+ tasks. withType(Javadoc ). configureEach {
6264 failOnError = false
6365 options. addStringOption(' Xdoclint:none' , ' -quiet' )
6466}
@@ -74,85 +76,6 @@ sourcesJar {
7476javadocJar {
7577 archiveBaseName = " ${ artifactId} "
7678}
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.apideck"
107- artifactId = " unify"
108- version = " 0.20.0"
109-
110- from components. java
111-
112- pom {
113- properties = [
114- ' maven.compiler.source' : ' 11' ,
115- ' maven.compiler.target' : ' 11' ,
116- ]
117- name = ' Apideck Java SDK'
118- description = ' SDK enabling Java developers to easily integrate with the Apideck API.'
119- url = ' https://github.com/apideck-libraries/sdk-java'
120- scm {
121- url = ' github.com/apideck-libraries/sdk-java'
122- connection = ' scm:git:ssh://git@github.com/apideck-libraries/sdk-java.git'
123- }
124- licenses {
125- license {
126- name = ' Apache 2.0'
127- url = ' https://www.apache.org/licenses/LICENSE-2.0.html'
128- }
129- }
130- developers {
131- developer {
132- name = ' Apideck'
133- organization = ' Apideck'
134- email = ' support@apideck.com'
135- }
136- }
137- organization {
138- name = ' Apideck'
139- url = ' www.apideck.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-
15679
15780dependencies {
15881 api ' com.fasterxml.jackson.core:jackson-annotations:2.18.2'
@@ -165,4 +88,58 @@ dependencies {
16588 api ' org.reactivestreams:reactive-streams:1.0.4'
16689}
16790
91+ ext {
92+ springBootVersion = ' 2.7.18'
93+ }
94+
95+ subprojects {
96+ // Ensure subprojects use the same group and version as root project
97+ group = rootProject. group
98+ version = rootProject. version
99+
100+ apply {
101+ plugin " java-library"
102+ plugin " io.spring.dependency-management"
103+ plugin " maven-publish"
104+ plugin " signing"
105+ plugin " cl.franciscosolis.sonatype-central-upload"
106+ }
107+ dependencyManagement {
108+ imports {
109+ mavenBom " org.springframework.boot:spring-boot-dependencies:${ rootProject.springBootVersion} "
110+ }
111+ }
112+ repositories {
113+ mavenCentral()
114+ }
115+ java {
116+ withSourcesJar()
117+ withJavadocJar()
118+ }
119+ tasks. withType(JavaCompile ). configureEach {
120+ options. release = 11
121+ }
122+
123+ model {
124+ tasks. generatePomFileForMavenPublication {
125+ destination = file(layout. buildDirectory. file(" pom.xml" ))
126+ }
127+ }
128+ // Apply publishing configuration to all subprojects - they'll check for publishingConfig internally
129+ apply from : rootProject. file(' publishing.gradle' )
130+ }
131+
132+ ext {
133+ publishingConfig = [
134+ groupId : group,
135+ artifactId : artifactId,
136+ version : version,
137+ name : " Apideck Java SDK" ,
138+ description : " SDK enabling Java developers to easily integrate with the Apideck API." ,
139+ publicationName : " maven"
140+ ]
141+ }
142+
143+ apply from : ' publishing.gradle'
144+
168145apply from : ' build-extras.gradle'
0 commit comments