Skip to content

Commit e0b9d23

Browse files
committed
Add a simple JReleaser configuration
1 parent 3635a18 commit e0b9d23

File tree

3 files changed

+55
-58
lines changed

3 files changed

+55
-58
lines changed

ci/release/Jenkinsfile

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,16 @@ pipeline {
5858
mavenLocalRepo: env.WORKSPACE_TMP + '/.m2repository') {
5959
configFileProvider([configFile(fileId: 'release.config.ssh', targetLocation: env.HOME + '/.ssh/config'),
6060
configFile(fileId: 'release.config.ssh.knownhosts', targetLocation: env.HOME + '/.ssh/known_hosts')]) {
61-
// using MAVEN_GPG_PASSPHRASE (the default env variable name for passphrase in maven gpg plugin)
62-
withCredentials([file(credentialsId: 'release.gpg.private-key', variable: 'RELEASE_GPG_PRIVATE_KEY_PATH'),
63-
string(credentialsId: 'release.gpg.passphrase', variable: 'MAVEN_GPG_PASSPHRASE')]) {
61+
withCredentials([// TODO: Once we switch to maven-central publishing (from nexus2) we need to add a new credentials
62+
// to use the following env variable names to set the user/password:
63+
// - JRELEASER_MAVENCENTRAL_USERNAME
64+
// - JRELEASER_MAVENCENTRAL_TOKEN
65+
// Also use the new `credentialsId` for Maven Central, e.g.:
66+
// usernamePassword(credentialsId: '???????', passwordVariable: 'JRELEASER_MAVENCENTRAL_TOKEN', usernameVariable: 'JRELEASER_MAVENCENTRAL_USERNAME'),
67+
usernamePassword(credentialsId: 'ossrh.sonatype.org', passwordVariable: 'JRELEASER_NEXUS2_PASSWORD', usernameVariable: 'JRELEASER_NEXUS2_USERNAME'),
68+
string(credentialsId: 'Hibernate-CI.github.com', variable: 'JRELEASER_GITHUB_TOKEN'),
69+
file(credentialsId: 'release.gpg.private-key', variable: 'RELEASE_GPG_PRIVATE_KEY_PATH'),
70+
string(credentialsId: 'release.gpg.passphrase', variable: 'JRELEASER_GPG_PASSPHRASE')]) {
6471
sshagent(['ed25519.Hibernate-CI.github.com']) {
6572
sh 'mvn -v'
6673
sh 'cat $HOME/.ssh/config'

jreleaser.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
project:
2+
languages:
3+
java:
4+
groupId: org.hibernate.infra.develocity
5+
6+
release:
7+
github:
8+
skipTag: true
9+
skipRelease: true
10+
tagName: '{{projectVersion}}'
11+
12+
# File signing is always active
13+
signing:
14+
mode: COMMAND
15+
active: RELEASE
16+
armored: true
17+
18+
# Deploy JARs and POMs to Maven Central
19+
deploy:
20+
maven:
21+
nexus2:
22+
maven-central:
23+
active: RELEASE
24+
url: https://oss.sonatype.org/service/local
25+
snapshotUrl: https://oss.sonatype.org/content/repositories/snapshots/
26+
closeRepository: true
27+
stagingRepositories:
28+
- target/staging-deploy/maven
29+
mavenCentral:
30+
maven-central:
31+
# TODO: Change to RELEASE once switching to Maven-Central:
32+
active: NEVER
33+
url: https://central.sonatype.com/api/v1/publisher
34+
snapshotSupported: false
35+
applyMavenCentralRules: true
36+
stagingRepositories:
37+
- target/staging-deploy/maven
38+
# Deployment identifier used for publication.
39+
# deploymentId: dd9991b0-18a7-41e7-b1fe-37b8ea936f85

pom.xml

Lines changed: 6 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,12 @@
2727
<maven.compiler.source>17</maven.compiler.source>
2828
<maven.compiler.release>17</maven.compiler.release>
2929
<maven.compiler.parameters>true</maven.compiler.parameters>
30-
<nexus-staging-maven-plugin.version>1.7.0</nexus-staging-maven-plugin.version>
3130
<maven-javadoc-plugin.version>3.11.2</maven-javadoc-plugin.version>
3231
<maven-source-plugin.version>3.3.1</maven-source-plugin.version>
3332
<maven-shade-plugin.version>3.6.0</maven-shade-plugin.version>
34-
<maven-gpg-plugin.version>3.2.7</maven-gpg-plugin.version>
3533
<!-- Run mvn wrapper:wrapper when updating the wrapper plugin version -->
3634
<maven-wrapper-plugin.version>3.3.2</maven-wrapper-plugin.version>
37-
38-
<gpg.sign.skip>true</gpg.sign.skip>
39-
40-
<!-- Repository Deployment URLs -->
41-
<ossrh.releases.repo.id>ossrh</ossrh.releases.repo.id>
42-
<ossrh.releases.repo.url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</ossrh.releases.repo.url>
43-
<ossrh.releases.repo.baseUrl>https://oss.sonatype.org/</ossrh.releases.repo.baseUrl>
44-
<ossrh.snapshots.repo.id>ossrh</ossrh.snapshots.repo.id>
45-
<ossrh.snapshots.repo.url>https://oss.sonatype.org/content/repositories/snapshots</ossrh.snapshots.repo.url>
35+
<maven-deploy-plugin.version>3.1.4</maven-deploy-plugin.version>
4636
</properties>
4737

4838
<dependencyManagement>
@@ -172,22 +162,8 @@
172162
</plugin>
173163
<plugin>
174164
<groupId>org.apache.maven.plugins</groupId>
175-
<artifactId>maven-gpg-plugin</artifactId>
176-
<version>${maven-gpg-plugin.version}</version>
177-
<executions>
178-
<execution>
179-
<id>sign-artifacts</id>
180-
<phase>verify</phase>
181-
<goals>
182-
<goal>sign</goal>
183-
</goals>
184-
<configuration>
185-
<skip>${gpg.sign.skip}</skip>
186-
<homedir>${env.RELEASE_GPG_HOMEDIR}</homedir>
187-
<bestPractices>true</bestPractices>
188-
</configuration>
189-
</execution>
190-
</executions>
165+
<artifactId>maven-deploy-plugin</artifactId>
166+
<version>${maven-deploy-plugin.version}</version>
191167
</plugin>
192168
</plugins>
193169
</build>
@@ -215,25 +191,12 @@
215191
<url>http://ci.hibernate.org/</url>
216192
</ciManagement>
217193

218-
<distributionManagement>
219-
<repository>
220-
<id>${ossrh.releases.repo.id}</id>
221-
<name>OSSRH Releases Repository</name>
222-
<url>${ossrh.releases.repo.url}</url>
223-
</repository>
224-
<snapshotRepository>
225-
<id>${ossrh.snapshots.repo.id}</id>
226-
<name>OSSRH Snapshots Repository</name>
227-
<url>${ossrh.snapshots.repo.url}</url>
228-
</snapshotRepository>
229-
</distributionManagement>
230-
231194
<scm>
232195
<url>https://github.com/hibernate/hibernate-develocity-maven-extension</url>
233196
<connection>scm:git:[email protected]:hibernate/hibernate-develocity-maven-extension.git</connection>
234197
<developerConnection>scm:git:[email protected]:hibernate/hibernate-develocity-maven-extension.git</developerConnection>
235-
<tag>HEAD</tag>
236-
</scm>
198+
<tag>HEAD</tag>
199+
</scm>
237200

238201
<issueManagement>
239202
<system>GitHub</system>
@@ -250,22 +213,10 @@
250213
</property>
251214
</activation>
252215
<properties>
253-
<gpg.sign.skip>false</gpg.sign.skip>
216+
<altDeploymentRepository>local::file:${maven.multiModuleProjectDirectory}/target/staging-deploy/maven</altDeploymentRepository>
254217
</properties>
255218
<build>
256219
<plugins>
257-
<plugin>
258-
<groupId>org.sonatype.plugins</groupId>
259-
<artifactId>nexus-staging-maven-plugin</artifactId>
260-
<version>${nexus-staging-maven-plugin.version}</version>
261-
<extensions>true</extensions>
262-
<configuration>
263-
<nexusUrl>${ossrh.releases.repo.baseUrl}</nexusUrl>
264-
<serverId>${ossrh.releases.repo.id}</serverId>
265-
<autoReleaseAfterClose>true</autoReleaseAfterClose>
266-
<keepStagingRepositoryOnCloseRuleFailure>true</keepStagingRepositoryOnCloseRuleFailure>
267-
</configuration>
268-
</plugin>
269220
<plugin>
270221
<groupId>org.apache.maven.plugins</groupId>
271222
<artifactId>maven-source-plugin</artifactId>

0 commit comments

Comments
 (0)