Skip to content

Commit 598b4e0

Browse files
committed
Add a simple JReleaser configuration
1 parent af485fa commit 598b4e0

File tree

3 files changed

+54
-64
lines changed

3 files changed

+54
-64
lines changed

ci/release/Jenkinsfile

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,19 @@ pipeline {
4949
def developmentVersion = Version.parseDevelopmentVersion(params.DEVELOPMENT_VERSION)
5050
echo "Performing full release for version ${releaseVersion.toString()}"
5151

52-
withMaven(mavenSettingsConfig: params.RELEASE_DRY_RUN ? null : 'ci-hibernate.deploy.settings.maven',
53-
mavenLocalRepo: env.WORKSPACE_TMP + '/.m2repository') {
52+
withMaven(mavenSettingsConfig: null, mavenLocalRepo: env.WORKSPACE_TMP + '/.m2repository') {
5453
configFileProvider([configFile(fileId: 'release.config.ssh', targetLocation: env.HOME + '/.ssh/config'),
5554
configFile(fileId: 'release.config.ssh.knownhosts', targetLocation: env.HOME + '/.ssh/known_hosts')]) {
56-
// using MAVEN_GPG_PASSPHRASE (the default env variable name for passphrase in maven gpg plugin)
57-
withCredentials([file(credentialsId: 'release.gpg.private-key', variable: 'RELEASE_GPG_PRIVATE_KEY_PATH'),
58-
string(credentialsId: 'release.gpg.passphrase', variable: 'MAVEN_GPG_PASSPHRASE')]) {
55+
withCredentials([// TODO: Once we switch to maven-central publishing (from nexus2) we need to add a new credentials
56+
// to use the following env variable names to set the user/password:
57+
// - JRELEASER_MAVENCENTRAL_USERNAME
58+
// - JRELEASER_MAVENCENTRAL_TOKEN
59+
// Also use the new `credentialsId` for Maven Central, e.g.:
60+
// usernamePassword(credentialsId: '???????', passwordVariable: 'JRELEASER_MAVENCENTRAL_TOKEN', usernameVariable: 'JRELEASER_MAVENCENTRAL_USERNAME'),
61+
usernamePassword(credentialsId: 'ossrh.sonatype.org', passwordVariable: 'JRELEASER_NEXUS2_PASSWORD', usernameVariable: 'JRELEASER_NEXUS2_USERNAME'),
62+
file(credentialsId: 'release.gpg.private-key', variable: 'RELEASE_GPG_PRIVATE_KEY_PATH'),
63+
string(credentialsId: 'release.gpg.passphrase', variable: 'JRELEASER_GPG_PASSPHRASE'),
64+
string(credentialsId: 'Hibernate-CI.github.com', variable: 'JRELEASER_GITHUB_TOKEN')]) {
5965
sshagent(['ed25519.Hibernate-CI.github.com']) {
6066
sh 'mvn -v'
6167
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
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: 4 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -76,18 +76,7 @@
7676
<maven-javadoc-plugin.version>3.11.2</maven-javadoc-plugin.version>
7777
<license-maven-plugin.version>5.0.0</license-maven-plugin.version>
7878
<version.enforcer.plugin>3.5.0</version.enforcer.plugin>
79-
<version.gpg.plugin>3.2.7</version.gpg.plugin>
80-
<version.nexus-staging.plugin>1.7.0</version.nexus-staging.plugin>
81-
82-
<gpg.sign.skip>true</gpg.sign.skip>
83-
<deploy.skip>true</deploy.skip>
84-
85-
<!-- Repository Deployment URLs -->
86-
<ossrh.releases.repo.id>ossrh</ossrh.releases.repo.id>
87-
<ossrh.releases.repo.url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</ossrh.releases.repo.url>
88-
<ossrh.releases.repo.baseUrl>https://oss.sonatype.org/</ossrh.releases.repo.baseUrl>
89-
<ossrh.snapshots.repo.id>ossrh</ossrh.snapshots.repo.id>
90-
<ossrh.snapshots.repo.url>https://oss.sonatype.org/content/repositories/snapshots</ossrh.snapshots.repo.url>
79+
<version.maven-deploy-plugin>3.1.4</version.maven-deploy-plugin>
9180
</properties>
9281

9382
<dependencies>
@@ -204,37 +193,8 @@
204193
</plugin>
205194
<plugin>
206195
<groupId>org.apache.maven.plugins</groupId>
207-
<artifactId>maven-gpg-plugin</artifactId>
208-
<version>${version.gpg.plugin}</version>
209-
<executions>
210-
<execution>
211-
<id>sign-artifacts</id>
212-
<phase>verify</phase>
213-
<goals>
214-
<goal>sign</goal>
215-
</goals>
216-
<configuration>
217-
<skip>${gpg.sign.skip}</skip>
218-
<homedir>${env.RELEASE_GPG_HOMEDIR}</homedir>
219-
<bestPractices>true</bestPractices>
220-
</configuration>
221-
</execution>
222-
</executions>
223-
</plugin>
224-
<plugin>
225-
<groupId>org.sonatype.plugins</groupId>
226-
<artifactId>nexus-staging-maven-plugin</artifactId>
227-
<version>${version.nexus-staging.plugin}</version>
228-
<extensions>true</extensions>
229-
<configuration>
230-
<skipNexusStagingDeployMojo>${deploy.skip}</skipNexusStagingDeployMojo>
231-
<serverId>${ossrh.releases.repo.id}</serverId>
232-
<!-- The following, by default, is only used for actual releases, not for snapshot deployments -->
233-
<nexusUrl>${ossrh.releases.repo.baseUrl}</nexusUrl>
234-
<!-- oss.sonatype.org has been very slow when closing repositories lately;
235-
let's raise the timeout until we switch to s01.sonatype.org -->
236-
<stagingProgressTimeoutMinutes>60</stagingProgressTimeoutMinutes>
237-
</configuration>
196+
<artifactId>maven-deploy-plugin</artifactId>
197+
<version>${version.maven-deploy-plugin}</version>
238198
</plugin>
239199
</plugins>
240200
</build>
@@ -249,8 +209,7 @@
249209
</property>
250210
</activation>
251211
<properties>
252-
<gpg.sign.skip>false</gpg.sign.skip>
253-
<deploy.skip>false</deploy.skip>
212+
<altDeploymentRepository>local::file:${maven.multiModuleProjectDirectory}/target/staging-deploy/maven</altDeploymentRepository>
254213
</properties>
255214
</profile>
256215
</profiles>
@@ -275,18 +234,4 @@
275234
<system>Jenkins</system>
276235
<url>http://ci.hibernate.org/</url>
277236
</ciManagement>
278-
279-
<distributionManagement>
280-
<repository>
281-
<id>${ossrh.releases.repo.id}</id>
282-
<name>OSSRH Releases Repository</name>
283-
<url>${ossrh.releases.repo.url}</url>
284-
</repository>
285-
<snapshotRepository>
286-
<id>${ossrh.snapshots.repo.id}</id>
287-
<name>OSSRH Snapshots Repository</name>
288-
<url>${ossrh.snapshots.repo.url}</url>
289-
</snapshotRepository>
290-
</distributionManagement>
291-
292237
</project>

0 commit comments

Comments
 (0)