Skip to content

Commit 89f2402

Browse files
committed
fix(jreleaser): wrap config in afterEvaluate and use providers
- Wrap JReleaser configuration in afterEvaluate block - Use providers.provider for stagingRepositories to avoid early evaluation - Keep all signing and nexus2 configuration intact
1 parent 5e08e40 commit 89f2402

1 file changed

Lines changed: 69 additions & 39 deletions

File tree

build.gradle.kts

Lines changed: 69 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -5,50 +5,80 @@ plugins {
55
}
66

77
import org.jreleaser.model.Active
8+
import org.jreleaser.model.Signing
89

9-
jreleaser {
10-
gitRootSearch.set(true)
11-
12-
project {
13-
name.set("jpasskit")
14-
description.set("Java Library for Apple PassKit Web Service")
15-
license.set("Apache-2.0")
16-
authors.set(listOf("Patrice Brend'amour"))
17-
copyright.set("2012-${java.util.Calendar.getInstance().get(java.util.Calendar.YEAR)} Patrice Brend'amour")
18-
}
19-
20-
release {
21-
github {
22-
repoOwner.set("drallgood")
10+
afterEvaluate {
11+
jreleaser {
12+
gitRootSearch.set(true)
13+
14+
project {
2315
name.set("jpasskit")
24-
overwrite.set(true)
25-
skipTag.set(true)
26-
changelog {
27-
preset.set("conventional-commits")
28-
skipMergeCommits.set(true)
16+
description.set("Java Library for Apple PassKit Web Service")
17+
license.set("Apache-2.0")
18+
authors.set(listOf("Patrice Brend'amour"))
19+
copyright.set("2012-${java.util.Calendar.getInstance().get(java.util.Calendar.YEAR)} Patrice Brend'amour")
20+
}
21+
22+
release {
23+
github {
24+
repoOwner.set("drallgood")
25+
name.set("jpasskit")
26+
overwrite.set(true)
27+
skipTag.set(true)
28+
changelog {
29+
preset.set("conventional-commits")
30+
skipMergeCommits.set(true)
31+
}
2932
}
3033
}
31-
}
32-
33-
signing {
34-
active.set(Active.ALWAYS)
35-
armored.set(true)
36-
}
37-
38-
deploy {
39-
maven {
40-
mavenCentral {
41-
create("release-deploy") {
42-
active.set(Active.RELEASE)
43-
url.set("https://central.sonatype.com/api/v1/publisher")
44-
stagingRepositories.set(
45-
listOf(
46-
layout.buildDirectory.dir("staging-deploy").get().asFile.absolutePath,
47-
project(":jpasskit").layout.buildDirectory.dir("staging-deploy").get().asFile.absolutePath,
48-
project(":jpasskit.server").layout.buildDirectory.dir("staging-deploy").get().asFile.absolutePath
34+
35+
signing {
36+
active.set(Active.ALWAYS)
37+
armored.set(true)
38+
command {
39+
executable.set("gpg")
40+
args.set(listOf("--batch", "--yes", "--pinentry-mode", "loopback"))
41+
keyName.set("9474B9FCBDF93BEE7CC4B69B4CE3C3B7A5E5FCC2")
42+
}
43+
mode.set(Signing.Mode.COMMAND)
44+
}
45+
46+
deploy {
47+
maven {
48+
mavenCentral {
49+
create("release-deploy") {
50+
active.set(Active.RELEASE)
51+
url.set("https://central.sonatype.com/api/v1/publisher")
52+
stagingRepositories.set(
53+
providers.provider {
54+
listOf(
55+
layout.buildDirectory.dir("staging-deploy").get().asFile.absolutePath,
56+
project(":jpasskit").layout.buildDirectory.dir("staging-deploy").get().asFile.absolutePath,
57+
project(":jpasskit.server").layout.buildDirectory.dir("staging-deploy").get().asFile.absolutePath
58+
)
59+
}
60+
)
61+
applyMavenCentralRules.set(true)
62+
}
63+
}
64+
nexus2 {
65+
create("snapshot-deploy") {
66+
active.set(Active.SNAPSHOT)
67+
url.set("https://central.sonatype.com/api/v1/publisher")
68+
snapshotUrl.set("https://central.sonatype.com/repository/maven-snapshots")
69+
stagingRepositories.set(
70+
providers.provider {
71+
listOf(
72+
layout.buildDirectory.dir("staging-deploy").get().asFile.absolutePath,
73+
project(":jpasskit").layout.buildDirectory.dir("staging-deploy").get().asFile.absolutePath,
74+
project(":jpasskit.server").layout.buildDirectory.dir("staging-deploy").get().asFile.absolutePath
75+
)
76+
}
4977
)
50-
)
51-
applyMavenCentralRules.set(true)
78+
applyMavenCentralRules.set(true)
79+
closeRepository.set(true)
80+
snapshotSupported.set(true)
81+
}
5282
}
5383
}
5484
}

0 commit comments

Comments
 (0)