Skip to content

Commit 85ac6b4

Browse files
authored
chore: use Jreleaser for codegen maven releases (#5910)
1 parent 343b066 commit 85ac6b4

File tree

1 file changed

+55
-28
lines changed

1 file changed

+55
-28
lines changed

codegen/build.gradle.kts

+55-28
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,17 @@
1212
* express or implied. See the License for the specific language governing
1313
* permissions and limitations under the License.
1414
*/
15+
16+
import org.jreleaser.model.Active
17+
1518
plugins {
1619
`java-library`
1720
`maven-publish`
1821
signing
1922
checkstyle
2023
jacoco
2124
id("com.github.spotbugs") version "4.7.1"
22-
id("io.codearte.nexus-staging") version "0.30.0"
25+
id("org.jreleaser") version "1.9.0"
2326
}
2427

2528
allprojects {
@@ -38,27 +41,6 @@ tasks["jar"].enabled = false
3841
val sonatypeUser: String? by project
3942
val sonatypePassword: String? by project
4043

41-
/*
42-
* Sonatype Staging Finalization
43-
* ====================================================
44-
*
45-
* When publishing to Maven Central, we need to close the staging
46-
* repository and release the artifacts after they have been
47-
* validated. This configuration is for the root project because
48-
* it operates at the "group" level.
49-
*/
50-
if (sonatypeUser != null && sonatypePassword != null) {
51-
apply(plugin = "io.codearte.nexus-staging")
52-
53-
nexusStaging {
54-
packageGroup = "software.amazon"
55-
stagingProfileId = "e789115b6c941"
56-
57-
username = sonatypeUser
58-
password = sonatypePassword
59-
}
60-
}
61-
6244
repositories {
6345
mavenLocal()
6446
mavenCentral()
@@ -141,12 +123,9 @@ subprojects {
141123

142124
publishing {
143125
repositories {
144-
mavenCentral {
145-
url = uri("https://aws.oss.sonatype.org/service/local/staging/deploy/maven2/")
146-
credentials {
147-
username = sonatypeUser
148-
password = sonatypePassword
149-
}
126+
maven {
127+
name = "stagingRepository"
128+
url = uri("${rootProject.buildDir}/staging")
150129
}
151130
}
152131

@@ -265,3 +244,51 @@ subprojects {
265244
}
266245
}
267246
}
247+
248+
/*
249+
* Jreleaser (https://jreleaser.org) config.
250+
*/
251+
jreleaser {
252+
dryrun = false
253+
254+
// Used for creating a tagged release, uploading files and generating changelog.
255+
// In the future we can set this up to push release tags to GitHub, but for now it's
256+
// set up to do nothing.
257+
// https://jreleaser.org/guide/latest/reference/release/index.html
258+
release {
259+
generic {
260+
enabled = true
261+
skipRelease = true
262+
}
263+
}
264+
265+
// Used to announce a release to configured announcers.
266+
// https://jreleaser.org/guide/latest/reference/announce/index.html
267+
announce {
268+
active = Active.NEVER
269+
}
270+
271+
// Signing configuration.
272+
// https://jreleaser.org/guide/latest/reference/signing.html
273+
signing {
274+
active = Active.ALWAYS
275+
armored = true
276+
}
277+
278+
// Configuration for deploying to Maven Central.
279+
// https://jreleaser.org/guide/latest/examples/maven/maven-central.html#_gradle
280+
deploy {
281+
maven {
282+
nexus2 {
283+
create("maven-central") {
284+
active = Active.ALWAYS
285+
url = "https://aws.oss.sonatype.org/service/local"
286+
snapshotUrl = "https://aws.oss.sonatype.org/content/repositories/snapshots"
287+
closeRepository.set(true)
288+
releaseRepository.set(true)
289+
stagingRepositories.add("${rootProject.buildDir}/staging")
290+
}
291+
}
292+
}
293+
}
294+
}

0 commit comments

Comments
 (0)