Skip to content

Commit 0b4ef38

Browse files
committed
fix(jreleaser): move JReleaser configuration to root build.gradle.kts
- Apply JReleaser plugin directly in root build.gradle.kts with version - Remove JReleaser configuration from convention plugin - This fixes the immutableRelease NullPointerException issue
1 parent d3da243 commit 0b4ef38

2 files changed

Lines changed: 69 additions & 70 deletions

File tree

build-logic/src/main/kotlin/de.brendamour.java-conventions.gradle.kts

Lines changed: 0 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -22,76 +22,6 @@ plugins {
2222
jacoco
2323
}
2424

25-
// Apply JReleaser plugin only to root project
26-
if (project == rootProject) {
27-
apply(plugin = "org.jreleaser")
28-
29-
// Configure JReleaser directly after applying the plugin
30-
configure<org.jreleaser.gradle.plugin.JReleaserExtension> {
31-
gitRootSearch.set(true)
32-
33-
project {
34-
name.set("jpasskit")
35-
description.set("Java Library for Apple PassKit Web Service")
36-
website.set(JPASSKIT_WEBSITE)
37-
license.set("Apache-2.0")
38-
authors.set(listOf(JPASSKIT_AUTHOR))
39-
}
40-
41-
release {
42-
github {
43-
repoOwner.set("drallgood")
44-
name.set("jpasskit")
45-
overwrite.set(true)
46-
skipTag.set(true) // We're creating the tag manually
47-
changelog {
48-
preset.set("conventional-commits")
49-
skipMergeCommits.set(true)
50-
}
51-
}
52-
}
53-
54-
signing {
55-
active.set(Active.ALWAYS)
56-
armored.set(true)
57-
command {
58-
executable.set("gpg")
59-
args.set(listOf("--batch", "--yes", "--pinentry-mode", "loopback"))
60-
keyName.set("9474B9FCBDF93BEE7CC4B69B4CE3C3B7A5E5FCC2")
61-
}
62-
mode.set(Signing.Mode.COMMAND)
63-
}
64-
65-
deploy {
66-
maven {
67-
val projs: List<Project> = listOf(rootProject) + rootProject.subprojects.toList()
68-
val stagingPaths: List<String> = projs.map { p: Project ->
69-
p.layout.buildDirectory.dir("staging-deploy").get().asFile.absolutePath
70-
}
71-
mavenCentral {
72-
create("release-deploy") {
73-
active.set(Active.RELEASE)
74-
url.set("https://central.sonatype.com/api/v1/publisher")
75-
stagingRepositories.set(providers.provider { stagingPaths })
76-
applyMavenCentralRules.set(true)
77-
}
78-
}
79-
nexus2 {
80-
create("snapshot-deploy") {
81-
active.set(Active.SNAPSHOT)
82-
url.set("https://central.sonatype.com/api/v1/publisher")
83-
snapshotUrl.set("https://central.sonatype.com/repository/maven-snapshots")
84-
stagingRepositories.set(providers.provider { stagingPaths })
85-
applyMavenCentralRules.set(true)
86-
closeRepository.set(true)
87-
snapshotSupported.set(true)
88-
}
89-
}
90-
}
91-
}
92-
}
93-
}
94-
9525
jacoco {
9626
toolVersion = "0.8.13"
9727
}

build.gradle.kts

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,75 @@
1+
import org.jreleaser.model.Active
2+
import org.jreleaser.model.Signing
3+
14
plugins {
25
`maven-publish`
36
id("de.brendamour.java-conventions")
7+
id("org.jreleaser") version "1.21.0"
8+
}
9+
10+
jreleaser {
11+
gitRootSearch.set(true)
12+
13+
project {
14+
name.set("jpasskit")
15+
description.set("Java Library for Apple PassKit Web Service")
16+
website.set("https://github.com/drallgood/jpasskit")
17+
license.set("Apache-2.0")
18+
authors.set(listOf("Patrice Brend'amour"))
19+
}
20+
21+
release {
22+
github {
23+
repoOwner.set("drallgood")
24+
name.set("jpasskit")
25+
overwrite.set(true)
26+
skipTag.set(true)
27+
changelog {
28+
preset.set("conventional-commits")
29+
skipMergeCommits.set(true)
30+
}
31+
}
32+
}
33+
34+
signing {
35+
active.set(Active.ALWAYS)
36+
armored.set(true)
37+
command {
38+
executable.set("gpg")
39+
args.set(listOf("--batch", "--yes", "--pinentry-mode", "loopback"))
40+
keyName.set("9474B9FCBDF93BEE7CC4B69B4CE3C3B7A5E5FCC2")
41+
}
42+
mode.set(Signing.Mode.COMMAND)
43+
}
44+
45+
deploy {
46+
maven {
47+
val stagingPaths = listOf(
48+
layout.buildDirectory.dir("staging-deploy").get().asFile.absolutePath,
49+
project(":jpasskit").layout.buildDirectory.dir("staging-deploy").get().asFile.absolutePath,
50+
project(":jpasskit.server").layout.buildDirectory.dir("staging-deploy").get().asFile.absolutePath
51+
)
52+
mavenCentral {
53+
create("release-deploy") {
54+
active.set(Active.RELEASE)
55+
url.set("https://central.sonatype.com/api/v1/publisher")
56+
stagingRepositories.set(stagingPaths)
57+
applyMavenCentralRules.set(true)
58+
}
59+
}
60+
nexus2 {
61+
create("snapshot-deploy") {
62+
active.set(Active.SNAPSHOT)
63+
url.set("https://central.sonatype.com/api/v1/publisher")
64+
snapshotUrl.set("https://central.sonatype.com/repository/maven-snapshots")
65+
stagingRepositories.set(stagingPaths)
66+
applyMavenCentralRules.set(true)
67+
closeRepository.set(true)
68+
snapshotSupported.set(true)
69+
}
70+
}
71+
}
72+
}
473
}
574

675
allprojects {

0 commit comments

Comments
 (0)