Skip to content

Commit f10125b

Browse files
committed
Update nexus staging plugin configuration
1 parent 2d2dc67 commit f10125b

File tree

2 files changed

+216
-12
lines changed

2 files changed

+216
-12
lines changed

build/reports/pom.xml

Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
~ Hibernate Validator, declare and validate application constraints
4+
~
5+
~ License: Apache License, Version 2.0
6+
~ See the license.txt file in the root directory or <http://www.apache.org/licenses/LICENSE-2.0>.
7+
-->
8+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
10+
<modelVersion>4.0.0</modelVersion>
11+
<parent>
12+
<groupId>org.hibernate.validator</groupId>
13+
<artifactId>hibernate-validator-internal-parent</artifactId>
14+
<version>9.0.0-SNAPSHOT</version>
15+
<relativePath>../../parents/internal</relativePath>
16+
</parent>
17+
<artifactId>hibernate-validator-reports</artifactId>
18+
19+
<name>Hibernate Validator Reports</name>
20+
<description>Hibernate Validator build reports</description>
21+
<packaging>pom</packaging>
22+
23+
<properties>
24+
<!--
25+
Disable the dependency convergence rule, because the dependencies of various integration tests do not converge
26+
-->
27+
<enforcer.dependencyconvergence.skip>true</enforcer.dependencyconvergence.skip>
28+
</properties>
29+
30+
<dependencies>
31+
<dependency>
32+
<groupId>org.hibernate.validator</groupId>
33+
<artifactId>hibernate-validator-test-utils</artifactId>
34+
</dependency>
35+
<dependency>
36+
<groupId>org.hibernate.validator</groupId>
37+
<artifactId>hibernate-validator</artifactId>
38+
</dependency>
39+
<dependency>
40+
<groupId>org.hibernate.validator</groupId>
41+
<artifactId>hibernate-validator-annotation-processor</artifactId>
42+
</dependency>
43+
<dependency>
44+
<groupId>org.hibernate.validator</groupId>
45+
<artifactId>hibernate-validator-cdi</artifactId>
46+
</dependency>
47+
48+
<dependency>
49+
<groupId>org.hibernate.validator</groupId>
50+
<artifactId>hibernate-validator-bom</artifactId>
51+
<version>${project.version}</version>
52+
<type>pom</type>
53+
</dependency>
54+
55+
<dependency>
56+
<groupId>org.hibernate.validator</groupId>
57+
<artifactId>hibernate-validator-build-enforcer</artifactId>
58+
<version>${project.version}</version>
59+
</dependency>
60+
<dependency>
61+
<groupId>org.hibernate.validator</groupId>
62+
<artifactId>hibernate-validator-build-config</artifactId>
63+
<version>${project.version}</version>
64+
</dependency>
65+
66+
<dependency>
67+
<groupId>org.hibernate.validator</groupId>
68+
<artifactId>hibernate-validator-tck-runner</artifactId>
69+
<version>${project.version}</version>
70+
<scope>test</scope>
71+
</dependency>
72+
<dependency>
73+
<groupId>org.hibernate.validator</groupId>
74+
<artifactId>hibernate-validator-performance</artifactId>
75+
<version>${project.version}</version>
76+
<scope>test</scope>
77+
</dependency>
78+
<dependency>
79+
<groupId>org.hibernate.validator</groupId>
80+
<artifactId>hibernate-validator-integrationtest-wildfly</artifactId>
81+
<version>${project.version}</version>
82+
<scope>test</scope>
83+
</dependency>
84+
<dependency>
85+
<groupId>org.hibernate.validator</groupId>
86+
<artifactId>hibernate-validator-integrationtest-java-modules-simple</artifactId>
87+
<version>${project.version}</version>
88+
<scope>test</scope>
89+
</dependency>
90+
<dependency>
91+
<groupId>org.hibernate.validator</groupId>
92+
<artifactId>hibernate-validator-integrationtest-java-modules-no-el</artifactId>
93+
<version>${project.version}</version>
94+
<scope>test</scope>
95+
</dependency>
96+
<dependency>
97+
<groupId>org.hibernate.validator</groupId>
98+
<artifactId>hibernate-validator-integrationtest-java-modules-test-utils</artifactId>
99+
<version>${project.version}</version>
100+
<scope>test</scope>
101+
</dependency>
102+
<dependency>
103+
<groupId>org.hibernate.validator</groupId>
104+
<artifactId>hibernate-validator-integrationtest-java-modules-cdi</artifactId>
105+
<version>${project.version}</version>
106+
<scope>test</scope>
107+
</dependency>
108+
109+
<dependency>
110+
<groupId>org.hibernate.validator</groupId>
111+
<artifactId>hibernate-validator-documentation</artifactId>
112+
<version>${project.version}</version>
113+
<scope>test</scope>
114+
</dependency>
115+
<dependency>
116+
<groupId>org.hibernate.validator</groupId>
117+
<artifactId>hibernate-validator-distribution</artifactId>
118+
<version>${project.version}</version>
119+
<scope>test</scope>
120+
</dependency>
121+
</dependencies>
122+
123+
<build>
124+
<plugins>
125+
<!--
126+
Hack to deploy in the "reports" module without deploying the "reports" module itself.
127+
The default lifecycle bindings of the plugin is to "stage locally" every artifact throughout
128+
the maven execution, and only actually deploy the "locally staged" artifacts
129+
in the very last executed module, which happens to be this "reports" module.
130+
However, this "reports" module does not generate any artifact we want to deploy.
131+
Thus, we'd like to prevent even its POM from being deployed: just deploy the "locally staged" artifacts,
132+
without adding the POM from the "reports" module to these artifacts.
133+
The default lifecycle bindings of the plugin does not offer a configuration option to do that,
134+
so we have to explicitly bind it
135+
-->
136+
<plugin>
137+
<groupId>org.sonatype.plugins</groupId>
138+
<artifactId>nexus-staging-maven-plugin</artifactId>
139+
<extensions>false</extensions>
140+
<!-- The <configuration> element is inherited from the parent module. -->
141+
<executions>
142+
<!-- Skip the default deployment, as explained above we don't want it. -->
143+
<execution>
144+
<id>default-deploy</id>
145+
<phase>none</phase>
146+
</execution>
147+
<!-- ... but execute the deferred deployment for the other modules -->
148+
<execution>
149+
<id>deferred-deploy</id>
150+
<phase>deploy</phase>
151+
<goals>
152+
<goal>deploy-staged</goal>
153+
</goals>
154+
</execution>
155+
</executions>
156+
</plugin>
157+
</plugins>
158+
</build>
159+
</project>

pom.xml

Lines changed: 57 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -662,6 +662,36 @@
662662
</execution>
663663
</executions>
664664
</plugin>
665+
<!--
666+
Configure the nexus-staging-maven-plugin explicitly (without <extension>true</extension>)
667+
in order to work around a problem in the "reports" module (see that module's POM for more info).
668+
-->
669+
<plugin>
670+
<groupId>org.sonatype.plugins</groupId>
671+
<artifactId>nexus-staging-maven-plugin</artifactId>
672+
<extensions>false</extensions><!-- This is essential: do not put true here -->
673+
<configuration>
674+
<serverId>${ossrh.releases.repo.id}</serverId>
675+
<!-- The following, by default, is only used for actual releases, not for snapshot deployments -->
676+
<nexusUrl>${ossrh.releases.repo.baseUrl}</nexusUrl>
677+
<!-- oss.sonatype.org has been very slow when closing repositories lately;
678+
let's raise the timeout until we switch to s01.sonatype.org -->
679+
<stagingProgressTimeoutMinutes>60</stagingProgressTimeoutMinutes>
680+
</configuration>
681+
<executions>
682+
<execution>
683+
<id>default-deploy</id>
684+
<phase>deploy</phase>
685+
<goals>
686+
<!--
687+
This will only put artifacts in a staging directory.
688+
See the "reports" module for actual deployment, at the end of the build.
689+
-->
690+
<goal>deploy</goal>
691+
</goals>
692+
</execution>
693+
</executions>
694+
</plugin>
665695
</plugins>
666696
<pluginManagement>
667697
<plugins>
@@ -1462,6 +1492,14 @@
14621492
<artifactId>versions-maven-plugin</artifactId>
14631493
<version>${version.versions.plugin}</version>
14641494
</plugin>
1495+
<plugin>
1496+
<groupId>org.sonatype.plugins</groupId>
1497+
<artifactId>nexus-staging-maven-plugin</artifactId>
1498+
<version>${version.nexus-staging-maven-plugin}</version>
1499+
<configuration>
1500+
<skipNexusStagingDeployMojo>${deploy.skip}</skipNexusStagingDeployMojo>
1501+
</configuration>
1502+
</plugin>
14651503
</plugins>
14661504
</pluginManagement>
14671505
</build>
@@ -1572,18 +1610,6 @@
15721610
</execution>
15731611
</executions>
15741612
</plugin>
1575-
<plugin>
1576-
<groupId>org.sonatype.plugins</groupId>
1577-
<artifactId>nexus-staging-maven-plugin</artifactId>
1578-
<version>${version.nexus-staging-maven-plugin}</version>
1579-
<extensions>true</extensions>
1580-
<configuration>
1581-
<skipNexusStagingDeployMojo>${deploy.skip}</skipNexusStagingDeployMojo>
1582-
<nexusUrl>${ossrh.releases.repo.baseUrl}</nexusUrl>
1583-
<serverId>${ossrh.releases.repo.id}</serverId>
1584-
<stagingProgressTimeoutMinutes>60</stagingProgressTimeoutMinutes>
1585-
</configuration>
1586-
</plugin>
15871613
<plugin>
15881614
<groupId>org.apache.maven.plugins</groupId>
15891615
<artifactId>maven-gpg-plugin</artifactId>
@@ -1820,5 +1846,24 @@
18201846
</pluginManagement>
18211847
</build>
18221848
</profile>
1849+
<!--
1850+
WARNING: this MUST be the very last profile,
1851+
so that the "report" module is the very last module,
1852+
in particular when deploying artifacts to a Nexus repository.
1853+
See the "build/reports" module POM for more information.
1854+
-->
1855+
<profile>
1856+
<id>build-reports-as-last-module</id>
1857+
<activation>
1858+
<property>
1859+
<name>!some.property.that.will.never.exist</name>
1860+
</property>
1861+
</activation>
1862+
<modules>
1863+
<module>build/reports</module>
1864+
</modules>
1865+
</profile>
1866+
1867+
<!-- DO NOT ADD ANY PROFILE AFTER THIS: see above -->
18231868
</profiles>
18241869
</project>

0 commit comments

Comments
 (0)