Skip to content

Commit e75447c

Browse files
authored
Jreleaser (#18)
* Added in jreleaser attempt 1 * More attempts * More attempts * 3.0.4
1 parent a7fe16e commit e75447c

File tree

5 files changed

+56
-27
lines changed

5 files changed

+56
-27
lines changed

build.gradle.kts

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,9 @@
1-
// For publishing, all of these are required in the top-level.
21

3-
plugins {
4-
id("io.github.gradle-nexus.publish-plugin") version "2.0.0"
5-
}
6-
nexusPublishing {
7-
repositories {
8-
sonatype()
9-
}
10-
}
112
allprojects {
123
group = "com.codeheadsystems"
13-
//version = "3.0.2"
14-
version = "3.0.3-SNAPSHOT"
4+
version = "3.0.4"
5+
//version = "3.0.3-SNAPSHOT"
156
}
16-
// gradle clean build test publishToSonatype closeAndReleaseSonatypeStagingRepository
7+
8+
// gradle jreleaserConfig
9+
// gradle clean build test public jreleaserDeploy

buildSrc/build.gradle.kts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ plugins {
88
}
99

1010
repositories {
11-
// Use the plugin portal to apply community plugins in convention plugins.
11+
mavenCentral()
1212
gradlePluginPortal()
1313
}
14+
15+
dependencies {
16+
implementation(libs.gradleplugin.jreleaser)
17+
}

buildSrc/settings.gradle.kts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,13 @@
55
*/
66

77
dependencyResolutionManagement {
8-
// Reuse version catalog from the main build.
98
versionCatalogs {
10-
create("libs", { from(files("../gradle/libs.versions.toml")) })
9+
create("libs") {
10+
from(files("../gradle/libs.versions.toml"))
11+
}
12+
}
13+
repositories {
14+
gradlePluginPortal()
15+
mavenCentral()
1116
}
1217
}
13-
14-
rootProject.name = "buildSrc"

buildSrc/src/main/kotlin/buildlogic.java-publish-conventions.gradle.kts

Lines changed: 35 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
2+
import org.jreleaser.model.Active
13
plugins {
2-
// Apply the java Plugin to add support for Java.
34
`maven-publish`
4-
signing
5+
id("org.jreleaser")
56
}
67

78
publishing {
@@ -36,15 +37,39 @@ publishing {
3637
}
3738
repositories {
3839
maven {
39-
val releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2"
40-
val snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots"
41-
url = uri(if (version.toString().endsWith("SNAPSHOT")) snapshotsRepoUrl else releasesRepoUrl)
42-
name = "ossrh"
43-
credentials(PasswordCredentials::class)
40+
setUrl(layout.buildDirectory.dir("staging-deploy"))
4441
}
4542
}
4643
}
47-
signing {
48-
useGpgCmd()
49-
sign(publishing.publications["mavenJava"])
44+
45+
jreleaser {
46+
gitRootSearch = true
47+
strict = false
48+
dryrun = false
49+
signing {
50+
active = Active.ALWAYS
51+
armored = true
52+
}
53+
release {
54+
github {
55+
enabled = true
56+
repoOwner = "wolpert"
57+
repoUrl = "https://github.com/wolpert/library"
58+
skipRelease = true
59+
skipTag = true
60+
sign = true
61+
overwrite = true
62+
}
63+
}
64+
deploy {
65+
maven {
66+
mavenCentral {
67+
register("sonatype") {
68+
active = Active.ALWAYS
69+
url = "https://central.sonatype.com/api/v1/publisher"
70+
stagingRepository("build/staging-deploy")
71+
}
72+
}
73+
}
74+
}
5075
}

gradle/libs.versions.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ commons-codec = "1.18.0"
1313
commons-io = "2.19.0"
1414
dagger = "2.56.2"
1515
dropwizard4 = "4.0.13"
16+
jreleaser = '1.18.0'
1617
jdbi = '3.49.4'
1718
jsr305 = "3.0.2"
1819
immutables = '2.10.1'
@@ -72,6 +73,9 @@ mockito-junit-jupiter = { module = "org.mockito:mockito-junit-jupiter", version.
7273
slf4j-api = { module = "org.slf4j:slf4j-api", version.ref = "slf4j" }
7374
testcontainers = { module = "org.testcontainers:testcontainers", version.ref = "testcontainers" }
7475
testcontainers-postgres = { module = "org.testcontainers:postgresql", version.ref = "testcontainers" }
76+
gradleplugin-jreleaser = { group = "org.jreleaser", name = "org.jreleaser.gradle.plugin", version.ref = "jreleaser" }
77+
[plugins]
78+
jreleaser = { id = "org.jreleaser", version.ref = "jreleaser" }
7579

7680
[bundles]
7781
caffine = ["caffine", "caffine-jcache"]

0 commit comments

Comments
 (0)