1
-
2
1
// //////////////////////////////////////////////////////////////////////////////////////////
3
2
// This file is generated by Speakeasy and any edits will be lost in generation updates.
4
3
//
9
8
// of string where each string value is an additional line in the block) in gen.yaml.
10
9
// //////////////////////////////////////////////////////////////////////////////////////////
11
10
11
+
12
12
plugins {
13
13
// Apply the java-library plugin for API and implementation separation.
14
14
id ' java-library'
15
15
id ' maven-publish'
16
16
id ' signing'
17
+ // V2 publishing plugin (Sonatype Central Portal)
17
18
id ' cl.franciscosolis.sonatype-central-upload' version ' 1.0.3'
19
+ id " io.spring.dependency-management" version " 1.1.6" apply false
18
20
}
19
21
20
22
compileJava. options. encoding = " UTF-8"
33
35
34
36
model {
35
37
tasks. generatePomFileForMavenPublication {
36
- destination = file(" $b uildDir / pom.xml" )
38
+ destination = file(layout . buildDirectory . file( " pom.xml" ) )
37
39
}
38
40
}
39
41
45
47
archiveBaseName = " ${ artifactId} "
46
48
47
49
into(" META-INF/maven/com.clerk/backend-api" ) {
48
- from(" $b uildDir / pom.xml" )
50
+ from(layout . buildDirectory . file( " pom.xml" ) )
49
51
}
50
52
}
51
53
@@ -58,7 +60,7 @@ javadoc {
58
60
options. addStringOption(' Xdoclint:none' , ' -quiet' )
59
61
}
60
62
61
- tasks. withType(Javadoc ) {
63
+ tasks. withType(Javadoc ). configureEach {
62
64
failOnError = false
63
65
options. addStringOption(' Xdoclint:none' , ' -quiet' )
64
66
}
@@ -74,93 +76,68 @@ sourcesJar {
74
76
javadocJar {
75
77
archiveBaseName = " ${ artifactId} "
76
78
}
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" )
79
+
80
+ dependencies {
81
+ api ' com.fasterxml.jackson.core:jackson-annotations:2.18.2'
82
+ implementation ' com.fasterxml.jackson.core:jackson-databind:2.18.2'
83
+ implementation ' com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.18.2'
84
+ implementation ' com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.18.2'
85
+ api(' org.openapitools:jackson-databind-nullable:0.2.6' ) {exclude group : ' com.fasterxml.jackson.core' , module : ' jackson-databind' }
86
+ implementation ' commons-io:commons-io:2.18.0'
97
87
}
98
88
89
+ ext {
90
+ springBootVersion = ' 2.7.18'
91
+ }
99
92
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
- }
141
- }
93
+ subprojects {
94
+ // Ensure subprojects use the same group and version as root project
95
+ group = rootProject. group
96
+ version = rootProject. version
97
+
98
+ apply {
99
+ plugin " java-library"
100
+ plugin " io.spring.dependency-management"
101
+ plugin " maven-publish"
102
+ plugin " signing"
103
+ plugin " cl.franciscosolis.sonatype-central-upload"
104
+ }
105
+ dependencyManagement {
106
+ imports {
107
+ mavenBom " org.springframework.boot:spring-boot-dependencies:${ rootProject.springBootVersion} "
142
108
}
143
109
}
144
- }
110
+ repositories {
111
+ mavenCentral()
112
+ }
113
+ java {
114
+ withSourcesJar()
115
+ withJavadocJar()
116
+ }
117
+ tasks. withType(JavaCompile ). configureEach {
118
+ options. release = 11
119
+ }
145
120
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
121
+ model {
122
+ tasks. generatePomFileForMavenPublication {
123
+ destination = file(layout. buildDirectory. file(" pom.xml" ))
124
+ }
152
125
}
126
+ // Apply publishing configuration to all subprojects - they'll check for publishingConfig internally
127
+ apply from : rootProject. file(' publishing.gradle' )
153
128
}
154
129
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 '
130
+ ext {
131
+ publishingConfig = [
132
+ groupId : group,
133
+ artifactId : artifactId,
134
+ version : version,
135
+ name : " My Company Java SDK " ,
136
+ description : " SDK enabling Java developers to easily integrate with the My Company API. " ,
137
+ publicationName : " maven "
138
+ ]
164
139
}
165
140
141
+ apply from : ' publishing.gradle'
142
+
166
143
apply from : ' build-extras.gradle'
0 commit comments