Skip to content

Commit 1ac5f79

Browse files
committed
HV-2096 Use JReleaser to publish hibernate artifacts
1 parent bf7f507 commit 1ac5f79

File tree

7 files changed

+65
-126
lines changed

7 files changed

+65
-126
lines changed

build/enforcer/pom.xml

-6
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,6 @@
4545

4646
<build>
4747
<plugins>
48-
<plugin>
49-
<artifactId>maven-gpg-plugin</artifactId>
50-
<configuration>
51-
<skip>true</skip>
52-
</configuration>
53-
</plugin>
5448
<plugin>
5549
<groupId>org.apache.maven.plugins</groupId>
5650
<artifactId>maven-enforcer-plugin</artifactId>

build/reports/pom.xml

-36
Original file line numberDiff line numberDiff line change
@@ -118,42 +118,6 @@
118118
</dependency>
119119
</dependencies>
120120

121-
<build>
122-
<plugins>
123-
<!--
124-
Hack to deploy in the "reports" module without deploying the "reports" module itself.
125-
The default lifecycle bindings of the plugin is to "stage locally" every artifact throughout
126-
the maven execution, and only actually deploy the "locally staged" artifacts
127-
in the very last executed module, which happens to be this "reports" module.
128-
However, this "reports" module does not generate any artifact we want to deploy.
129-
Thus, we'd like to prevent even its POM from being deployed: just deploy the "locally staged" artifacts,
130-
without adding the POM from the "reports" module to these artifacts.
131-
The default lifecycle bindings of the plugin does not offer a configuration option to do that,
132-
so we have to explicitly bind it
133-
-->
134-
<plugin>
135-
<groupId>org.sonatype.plugins</groupId>
136-
<artifactId>nexus-staging-maven-plugin</artifactId>
137-
<extensions>false</extensions>
138-
<!-- The <configuration> element is inherited from the parent module. -->
139-
<executions>
140-
<!-- Skip the default deployment, as explained above we don't want it. -->
141-
<execution>
142-
<id>default-deploy</id>
143-
<phase>none</phase>
144-
</execution>
145-
<!-- ... but execute the deferred deployment for the other modules -->
146-
<execution>
147-
<id>deferred-deploy</id>
148-
<phase>deploy</phase>
149-
<goals>
150-
<goal>deploy-staged</goal>
151-
</goals>
152-
</execution>
153-
</executions>
154-
</plugin>
155-
</plugins>
156-
</build>
157121
<profiles>
158122
<profile>
159123
<id>coverage-report</id>

distribution/pom.xml

-3
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@
1919
<description>Builds the distribution bundles</description>
2020

2121
<properties>
22-
<!-- Skip artifact deployment -->
23-
<maven.deploy.skip>true</maven.deploy.skip>
24-
<gpg.skip>true</gpg.skip>
2522
<!--
2623
Any javadoc warnings should've been caught already while the previous modules were built.
2724
Also see additional explanations on this property in the `hibernate-search-mapper-orm-jakarta-batch-core` module.

documentation/pom.xml

-3
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@
3131
<html.google-analytics.id>G-282CVRCQHZ</html.google-analytics.id>
3232
<html.outdated-content.project-key>${html.meta.project-key}</html.outdated-content.project-key>
3333

34-
<!-- Skip artifact deployment -->
35-
<maven.deploy.skip>true</maven.deploy.skip>
36-
<gpg.skip>true</gpg.skip>
3734
<surefire.jvm.args.additional>-Duser.language=en -Duser.country=US</surefire.jvm.args.additional>
3835

3936
<forbiddenapis-junit.path>forbidden-allow-junit.txt</forbiddenapis-junit.path>

jreleaser.yml

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
project:
2+
languages:
3+
java:
4+
groupId: org.hibernate.validator
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+
releaseRepository: false
28+
stagingRepositories:
29+
- target/staging-deploy/maven
30+
maven-central-snapshot:
31+
active: SNAPSHOT
32+
url: https://oss.sonatype.org/service/local
33+
snapshotUrl: https://oss.sonatype.org/content/repositories/snapshots/
34+
closeRepository: true
35+
releaseRepository: true
36+
javadocJar: false
37+
sign: false
38+
stagingRepositories:
39+
- target/staging-deploy/maven
40+
mavenCentral:
41+
maven-central:
42+
# TODO: HV-2097 Change to RELEASE once switching to Maven-Central:
43+
active: NEVER
44+
url: https://central.sonatype.com/api/v1/publisher
45+
snapshotSupported: false
46+
applyMavenCentralRules: true
47+
stagingRepositories:
48+
- target/staging-deploy/maven
49+
# Deployment identifier used for publication.
50+
# deploymentId: dd9991b0-18a7-41e7-b1fe-37b8ea936f85
51+
maven-central-snapshot:
52+
# TODO: HV-2097 Change to SNAPSHOT once switching to Maven-Central:
53+
active: NEVER
54+
url: https://central.sonatype.com/api/v1/publisher
55+
snapshotSupported: true
56+
applyMavenCentralRules: true
57+
javadocJar: false
58+
sign: false
59+
stagingRepositories:
60+
- target/staging-deploy/maven
61+
# Deployment identifier used for publication.
62+
# deploymentId: dd9991b0-18a7-41e7-b1fe-37b8ea936f85

parents/public/pom.xml

-4
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,6 @@
5757
<groupId>org.apache.maven.plugins</groupId>
5858
<artifactId>maven-source-plugin</artifactId>
5959
</plugin>
60-
<plugin>
61-
<groupId>org.apache.maven.plugins</groupId>
62-
<artifactId>maven-gpg-plugin</artifactId>
63-
</plugin>
6460
</plugins>
6561
</build>
6662

pom.xml

+3-74
Original file line numberDiff line numberDiff line change
@@ -745,36 +745,6 @@
745745
</execution>
746746
</executions>
747747
</plugin>
748-
<!--
749-
Configure the nexus-staging-maven-plugin explicitly (without <extension>true</extension>)
750-
in order to work around a problem in the "reports" module (see that module's POM for more info).
751-
-->
752-
<plugin>
753-
<groupId>org.sonatype.plugins</groupId>
754-
<artifactId>nexus-staging-maven-plugin</artifactId>
755-
<extensions>false</extensions><!-- This is essential: do not put true here -->
756-
<configuration>
757-
<serverId>${ossrh.releases.repo.id}</serverId>
758-
<!-- The following, by default, is only used for actual releases, not for snapshot deployments -->
759-
<nexusUrl>${ossrh.releases.repo.baseUrl}</nexusUrl>
760-
<!-- oss.sonatype.org has been very slow when closing repositories lately;
761-
let's raise the timeout until we switch to s01.sonatype.org -->
762-
<stagingProgressTimeoutMinutes>60</stagingProgressTimeoutMinutes>
763-
</configuration>
764-
<executions>
765-
<execution>
766-
<id>default-deploy</id>
767-
<phase>deploy</phase>
768-
<goals>
769-
<!--
770-
This will only put artifacts in a staging directory.
771-
See the "reports" module for actual deployment, at the end of the build.
772-
-->
773-
<goal>deploy</goal>
774-
</goals>
775-
</execution>
776-
</executions>
777-
</plugin>
778748
</plugins>
779749
<pluginManagement>
780750
<plugins>
@@ -1199,13 +1169,9 @@
11991169
<version>${version.deploy.plugin}</version>
12001170
<configuration>
12011171
<!-- we use the nexus-staging plugin -->
1202-
<skip>${maven-deploy-plugin.skip}</skip>
1172+
<skip>${deploy.skip}</skip>
12031173
</configuration>
12041174
</plugin>
1205-
<plugin>
1206-
<artifactId>maven-gpg-plugin</artifactId>
1207-
<version>${version.gpg.plugin}</version>
1208-
</plugin>
12091175
<plugin>
12101176
<artifactId>maven-resources-plugin</artifactId>
12111177
<version>${version.resources.plugin}</version>
@@ -1563,14 +1529,6 @@
15631529
<artifactId>versions-maven-plugin</artifactId>
15641530
<version>${version.versions.plugin}</version>
15651531
</plugin>
1566-
<plugin>
1567-
<groupId>org.sonatype.plugins</groupId>
1568-
<artifactId>nexus-staging-maven-plugin</artifactId>
1569-
<version>${version.nexus-staging-maven-plugin}</version>
1570-
<configuration>
1571-
<skipNexusStagingDeployMojo>${deploy.skip}</skipNexusStagingDeployMojo>
1572-
</configuration>
1573-
</plugin>
15741532
<plugin>
15751533
<groupId>org.apache.maven.plugins</groupId>
15761534
<artifactId>maven-wrapper-plugin</artifactId>
@@ -1637,19 +1595,6 @@
16371595
<tag>HEAD</tag>
16381596
</scm>
16391597

1640-
<distributionManagement>
1641-
<repository>
1642-
<id>${ossrh.releases.repo.id}</id>
1643-
<name>OSSRH Releases Repository</name>
1644-
<url>${ossrh.releases.repo.url}</url>
1645-
</repository>
1646-
<snapshotRepository>
1647-
<id>${ossrh.snapshots.repo.id}</id>
1648-
<name>OSSRH Snapshots Repository</name>
1649-
<url>${ossrh.snapshots.repo.url}</url>
1650-
</snapshotRepository>
1651-
</distributionManagement>
1652-
16531598
<profiles>
16541599
<profile>
16551600
<id>docs</id>
@@ -1680,6 +1625,7 @@
16801625
<properties>
16811626
<!-- We want this execution to happen before moditect (which executes at package phase) -->
16821627
<javadoc.generate.jar.phase>prepare-package</javadoc.generate.jar.phase>
1628+
<altDeploymentRepository>local::file:${maven.multiModuleProjectDirectory}/target/staging-deploy/maven</altDeploymentRepository>
16831629
</properties>
16841630
<build>
16851631
<plugins>
@@ -1695,24 +1641,7 @@
16951641
<rules>
16961642
<requireReleaseDeps />
16971643
</rules>
1698-
<fail>true</fail>
1699-
</configuration>
1700-
</execution>
1701-
</executions>
1702-
</plugin>
1703-
<plugin>
1704-
<groupId>org.apache.maven.plugins</groupId>
1705-
<artifactId>maven-gpg-plugin</artifactId>
1706-
<executions>
1707-
<execution>
1708-
<id>sign-artifacts</id>
1709-
<phase>verify</phase>
1710-
<goals>
1711-
<goal>sign</goal>
1712-
</goals>
1713-
<configuration>
1714-
<homedir>${env.RELEASE_GPG_HOMEDIR}</homedir>
1715-
<bestPractices>true</bestPractices>
1644+
<fail>false</fail>
17161645
</configuration>
17171646
</execution>
17181647
</executions>

0 commit comments

Comments
 (0)