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.clerk/backend-api" ) {
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,93 +73,69 @@ 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" )
76+
77+ dependencies {
78+ api ' com.fasterxml.jackson.core:jackson-annotations:2.18.2'
79+ implementation ' com.fasterxml.jackson.core:jackson-databind:2.18.2'
80+ implementation ' com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.18.2'
81+ implementation ' com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.18.2'
82+ api(' org.openapitools:jackson-databind-nullable:0.2.6' ) {exclude group : ' com.fasterxml.jackson.core' , module : ' jackson-databind' }
83+ implementation ' commons-io:commons-io:2.18.0'
84+ implementation ' jakarta.annotation:jakarta.annotation-api:3.0.0'
9785}
9886
87+ ext {
88+ springBootVersion = ' 2.7.18'
89+ }
9990
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.clerk"
107- artifactId = " backend-api"
108- version = " 3.2.0"
109-
110- from components. java
111-
112- pom {
113- properties = [
114- ' maven.compiler.source' : ' 11' ,
115- ' maven.compiler.target' : ' 11' ,
116- ]
117- name = ' My Company Java SDK'
118- description = ' SDK enabling Java developers to easily integrate with the My Company API.'
119- url = ' https://github.com/owner/repo'
120- scm {
121- url = ' github.com/owner/repo'
122- connection
= ' scm:git:ssh://[email protected] /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 = ' My Company'
133- organization = ' My Company'
134- 135- }
136- }
137- organization {
138- name = ' My Company'
139- url = ' www.mycompany.com'
140- }
91+ subprojects {
92+ if (name in [
93+ ' backend-api-spring-boot-autoconfigure' ,
94+ ' backend-api-spring-boot-starter'
95+ ]) {
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} "
141110 }
142111 }
143- }
144- }
112+ repositories {
113+ mavenCentral()
114+ }
115+ java {
116+ withSourcesJar()
117+ withJavadocJar()
118+ }
119+ tasks. withType(JavaCompile ). configureEach {
120+ options. release = 11
121+ }
145122
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
123+ // Apply publishing configuration to all subprojects - they'll check for publishingConfig internally
124+ apply from : rootProject. file(' publishing.gradle' )
152125 }
153126}
154127
155-
156-
157- dependencies {
158- api ' com.fasterxml.jackson.core:jackson-annotations:2.18.2 '
159- implementation ' com.fasterxml.jackson.core:jackson-databind:2.18.2 '
160- implementation ' com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.18.2 '
161- implementation ' com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.18.2 '
162- api( ' org.openapitools:jackson-databind-nullable:0.2.6 ' ) {exclude group : ' com.fasterxml.jackson.core ' , module : ' jackson-databind ' }
163- implementation ' commons-io:commons-io:2.18.0 '
128+ ext {
129+ publishingConfig = [
130+ groupId : group,
131+ artifactId : artifactId,
132+ version : version,
133+ name : " My Company Java SDK " ,
134+ description : " SDK enabling Java developers to easily integrate with the My Company API. " ,
135+ publicationName : " maven "
136+ ]
164137}
165138
139+ apply from : ' publishing.gradle'
140+
166141apply from : ' build-extras.gradle'
0 commit comments