Skip to content

Commit e1893c8

Browse files
committed
[#704] Update release to JBoss Nexus
This is only for SNAPSHOTS and it now uses the gradle-nexus-plugin.
1 parent 0e53fad commit e1893c8

File tree

3 files changed

+23
-31
lines changed

3 files changed

+23
-31
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ jobs:
192192
ORG_GRADLE_PROJECT_jbossNexusUser: ${{ secrets.JBOSS_NEXUS_USER }}
193193
ORG_GRADLE_PROJECT_jbossNexusPassword: ${{ secrets.JBOSS_NEXUS_PASSWORD }}
194194
if: endsWith( steps.detect-version.outputs.version, '-SNAPSHOT' ) && env.ORG_GRADLE_PROJECT_jbossNexusUser
195-
run: ./gradlew publish
195+
run: ./gradlew publishToJBossNexus closeAndReleaseJBossNexusStagingRepository
196196

197197
release:
198198
name: Release

build.gradle

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,16 @@ plugins {
1010
}
1111

1212
ext {
13+
// Credentials can be specified on the command-line using project properties,
14+
// or stored locally using the gradle-credentials-plugin.
15+
// See below for the name of project properties.
16+
// See https://github.com/etiennestuder/gradle-credentials-plugin to store credentials locally.
17+
if (!project.hasProperty('jbossNexusUser')) {
18+
jbossNexusUser = credentials.jbossNexusUser
19+
}
20+
if (!project.hasProperty('jbossNexusPassword')) {
21+
jbossNexusPassword = credentials.jbossNexusPassword
22+
}
1323
if (!project.hasProperty('sonatypeOssrhUser')) {
1424
sonatypeOssrhUser = credentials.sonatypeOssrhUser
1525
}
@@ -79,12 +89,24 @@ ext {
7989
logger.lifecycle "Hibernate Reactive: " + project.version
8090
}
8191

92+
// To release, see task ciRelease in release/build.gradle
93+
94+
// To publish snapshots:
95+
// ./gradlew publishToJBossNexus closeAndReleaseJBossNexusStagingRepository -PjbossNexusUser="<YOUR USERNAME>" -PjbossNexusPassword="<YOUR PASSWORD>"
96+
97+
// To publish on Sonatype (Maven Central):
98+
// ./gradlew publishToSonatype closeAndReleaseStagingRepository -PsonatypeOssrhUser="<YOUR USERNAME>" -PsonatypeOssrhPassword="<YOUR PASSWORD>"
8299
nexusPublishing {
83100
repositories {
84101
sonatype {
85102
username = project.sonatypeOssrhUser
86103
password = project.sonatypeOssrhPassword
87104
}
105+
jBossNexus {
106+
snapshotRepositoryUrl = uri('https://repository.jboss.org/nexus/content/repositories/snapshots')
107+
username = project.jbossNexusUser
108+
password = project.jbossNexusPassword
109+
}
88110
}
89111
}
90112

publish.gradle

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,6 @@
11
apply plugin: 'maven-publish'
22
apply plugin: 'nu.studer.credentials'
33

4-
// To publish snapshots:
5-
// ./gradlew publish -PjbossNexusUser="<YOUR USERNAME>" -PjbossNexusPassword="<YOUR PASSWORD>"
6-
// To release, see task ciRelease in release/build.gradle
7-
// To publish on Sonatype (Maven Central):
8-
// ./gradlew publishToSonatype closeAndReleaseStagingRepository -PsonatypeOssrhUser="<YOUR USERNAME>" -PsonatypeOssrhPassword="<YOUR PASSWORD>"
9-
10-
ext {
11-
// Credentials can be specified on the command-line using project properties,
12-
// or stored locally using the gradle-credentials-plugin.
13-
// See below for the name of project properties.
14-
// See https://github.com/etiennestuder/gradle-credentials-plugin to store credentials locally.
15-
if (!project.hasProperty('jbossNexusUser')) {
16-
jbossNexusUser = credentials.jbossNexusUser
17-
}
18-
if (!project.hasProperty('jbossNexusPassword')) {
19-
jbossNexusPassword = credentials.jbossNexusPassword
20-
}
21-
}
22-
234
task sourcesJar(type: Jar) {
245
from sourceSets.main.allJava
256
archiveClassifier = 'sources'
@@ -54,17 +35,6 @@ javadoc {
5435
}
5536

5637
publishing {
57-
repositories {
58-
// mavenLocal()
59-
maven {
60-
name 'jboss-snapshots-repository'
61-
url 'https://repository.jboss.org/nexus/content/repositories/snapshots'
62-
credentials {
63-
username project.jbossNexusUser
64-
password project.jbossNexusPassword
65-
}
66-
}
67-
}
6838
publications {
6939
logger.lifecycle "Publishing groupId: '" + project.group + "', version: '" + project.version + "'"
7040

0 commit comments

Comments
 (0)