|
104 | 104 |
|
105 | 105 | <!-- Plugins not managed by the JBoss parent POM: -->
|
106 | 106 | <maven-wrapper-plugin.version>3.3.2</maven-wrapper-plugin.version>
|
| 107 | + <nexus-staging.plugin.version>1.7.0</nexus-staging.plugin.version> |
| 108 | + <flatten-maven-plugin.version>1.5.0</flatten-maven-plugin.version> |
| 109 | + |
| 110 | + <!-- |
| 111 | + We don't want to publish or sign any modules by default. |
| 112 | + Specific modules will override the setting at their own level. |
| 113 | + --> |
| 114 | + <deploy.skip>true</deploy.skip> |
| 115 | + <maven-deploy-plugin.skip>true</maven-deploy-plugin.skip> |
| 116 | + |
| 117 | + <!-- Repository Deployment URLs --> |
| 118 | + <ossrh.releases.repo.id>ossrh</ossrh.releases.repo.id> |
| 119 | + <ossrh.releases.repo.name>Sonatype OSSRH Releases</ossrh.releases.repo.name> |
| 120 | + <ossrh.releases.repo.url>https://oss.sonatype.org/service/local/staging/deploy/maven2</ossrh.releases.repo.url> |
| 121 | + <ossrh.releases.repo.baseUrl>https://oss.sonatype.org</ossrh.releases.repo.baseUrl> |
| 122 | + <ossrh.snapshots.repo.id>ossrh</ossrh.snapshots.repo.id> |
| 123 | + <ossrh.snapshots.repo.name>Sonatype OSSRH Snapshots</ossrh.snapshots.repo.name> |
| 124 | + <ossrh.snapshots.repo.url>https://oss.sonatype.org/content/repositories/snapshots</ossrh.snapshots.repo.url> |
107 | 125 |
|
108 | 126 | <maven.compiler.target>11</maven.compiler.target>
|
109 | 127 | <maven.compiler.source>11</maven.compiler.source>
|
|
228 | 246 | </dependencies>
|
229 | 247 | </dependencyManagement>
|
230 | 248 |
|
231 |
| - <repositories> |
| 249 | + <distributionManagement> |
232 | 250 | <repository>
|
233 |
| - <snapshots> |
234 |
| - <enabled>false</enabled> |
235 |
| - </snapshots> |
236 |
| - <id>ossrh-releases-repository</id> |
237 |
| - <name>Sonatype OSSRH Releases</name> |
238 |
| - <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url> |
| 251 | + <id>${ossrh.releases.repo.id}</id> |
| 252 | + <name>${ossrh.releases.repo.name}</name> |
| 253 | + <url>${ossrh.releases.repo.url}</url> |
239 | 254 | </repository>
|
240 |
| - <repository> |
241 |
| - <snapshots> |
242 |
| - <enabled>true</enabled> |
243 |
| - </snapshots> |
244 |
| - <id>ossrh-snapshots-repository</id> |
245 |
| - <name>Sonatype OSSRH Snapshots</name> |
246 |
| - <url>https://oss.sonatype.org/content/repositories/snapshots/</url> |
247 |
| - </repository> |
248 |
| - </repositories> |
249 |
| - |
250 |
| - <distributionManagement> |
251 |
| - <repository> |
252 |
| - <id>ossrh-releases-repository</id> |
253 |
| - <name>Sonatype OSSRH Releases</name> |
254 |
| - <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url> |
255 |
| - </repository> |
256 |
| - <snapshotRepository> |
257 |
| - <id>ossrh-snapshots-repository</id> |
258 |
| - <name>Sonatype OSSRH Snapshots</name> |
259 |
| - <url>https://oss.sonatype.org/content/repositories/snapshots/</url> |
260 |
| - </snapshotRepository> |
| 255 | + <snapshotRepository> |
| 256 | + <id>${ossrh.snapshots.repo.id}</id> |
| 257 | + <name>${ossrh.snapshots.repo.name}</name> |
| 258 | + <url>${ossrh.snapshots.repo.url}</url> |
| 259 | + </snapshotRepository> |
261 | 260 | </distributionManagement>
|
262 | 261 |
|
263 | 262 | <build>
|
|
272 | 271 | <distributionType>bin</distributionType>
|
273 | 272 | </configuration>
|
274 | 273 | </plugin>
|
| 274 | + <!-- Published artifacts have to be signed: --> |
| 275 | + <plugin> |
| 276 | + <groupId>org.apache.maven.plugins</groupId> |
| 277 | + <artifactId>maven-gpg-plugin</artifactId> |
| 278 | + <executions> |
| 279 | + <execution> |
| 280 | + <id>sign-artifacts</id> |
| 281 | + <phase>verify</phase> |
| 282 | + <goals> |
| 283 | + <goal>sign</goal> |
| 284 | + </goals> |
| 285 | + <configuration> |
| 286 | + <skip>${deploy.skip}</skip> |
| 287 | + <homedir>${env.RELEASE_GPG_HOMEDIR}</homedir> |
| 288 | + </configuration> |
| 289 | + </execution> |
| 290 | + </executions> |
| 291 | + </plugin> |
| 292 | + <plugin> |
| 293 | + <groupId>org.sonatype.plugins</groupId> |
| 294 | + <artifactId>nexus-staging-maven-plugin</artifactId> |
| 295 | + <version>${nexus-staging.plugin.version}</version> |
| 296 | + <extensions>false</extensions><!-- This is essential: do not put true here --> |
| 297 | + <configuration> |
| 298 | + <skipNexusStagingDeployMojo>${deploy.skip}</skipNexusStagingDeployMojo> |
| 299 | + <serverId>${ossrh.releases.repo.id}</serverId> |
| 300 | + <!-- The following, by default, is only used for actual releases, not for snapshot deployments --> |
| 301 | + <nexusUrl>${ossrh.releases.repo.baseUrl}</nexusUrl> |
| 302 | + <!-- oss.sonatype.org has been very slow when closing repositories lately; |
| 303 | + let's raise the timeout until we switch to s01.sonatype.org --> |
| 304 | + <stagingProgressTimeoutMinutes>60</stagingProgressTimeoutMinutes> |
| 305 | + </configuration> |
F438
| 306 | + </plugin> |
| 307 | + <plugin> |
| 308 | + <groupId>org.codehaus.mojo</groupId> |
| 309 | + <artifactId>flatten-maven-plugin</artifactId> |
| 310 | + <version>${flatten-maven-plugin.version}</version> |
| 311 | + <configuration> |
| 312 | + <outputDirectory>${project.build.directory}</outputDirectory> |
| 313 | + <!-- Keep things like url, inceptionYear, authors... |
| 314 | + everything that's required by the OSSRH Maven repository --> |
| 315 | + <flattenMode>ossrh</flattenMode> |
| 316 | + <!-- To make sure that `hibernate-tools-gradle` module that has a pom packaging will also publish the flattened pom --> |
| 317 | + <updatePomFile>true</updatePomFile> |
| 318 | + </configuration> |
| 319 | + <executions> |
| 320 | + <execution> |
| 321 | + <id>flatten-pom</id> |
| 322 | + <phase>process-resources</phase> |
| 323 | + <goals> |
| 324 | + <goal>flatten</goal> |
| 325 | + </goals> |
| 326 | + </execution> |
| 327 | + </executions> |
| 328 | + </plugin> |
275 | 329 | </plugins>
|
276 | 330 | </pluginManagement>
|
| 331 | + <plugins> |
| 332 | + <!-- Skip the deploy plugin explicitly: we use nexus-staging-maven-plugin instead --> |
| 333 | + <plugin> |
| 334 | + <groupId>org.apache.maven.plugins</groupId> |
| 335 | + <artifactId>maven-deploy-plugin</artifactId> |
| 336 | + <configuration> |
| 337 | + <skip>${maven-deploy-plugin.skip}</skip> |
| 338 | + </configuration> |
| 339 | + </plugin> |
| 340 | + <!-- |
| 341 | + Configure the nexus-staging-maven-plugin explicitly (without <extension>true</extension>) |
| 342 | + in order to work around a problem in the "reports" module (see that module's POM for more info). |
| 343 | + --> |
| 344 | + <plugin> |
| 345 | + <groupId>org.sonatype.plugins</groupId> |
| 346 | + <artifactId>nexus-staging-maven-plugin</artifactId> |
| 347 | + <executions> |
| 348 | + <execution> |
| 349 | + <id>default-deploy</id> |
| 350 | + <phase>deploy</phase> |
| 351 | + <goals> |
| 352 | + <!-- |
| 353 | + This will only put artifacts in a staging directory. |
| 354 | + See the "reports" module for actual deployment, at the end of the build. |
| 355 | + --> |
| 356 | + <goal>deploy</goal> |
| 357 | + </goals> |
| 358 | + </execution> |
| 359 | + </executions> |
| 360 | + </plugin> |
| 361 | + <plugin> |
| 362 | + <groupId>org.codehaus.mojo</groupId> |
| 363 | + <artifactId>flatten-maven-plugin</artifactId> |
| 364 | + </plugin> |
| 365 | + <plugin> |
| 366 | + <groupId>org.apache.maven.plugins</groupId> |
| 367 | + <artifactId>maven-enforcer-plugin</artifactId> |
| 368 | + <executions> |
| 369 | + <execution> |
| 370 | + <id>enforce-java-version</id> |
| 371 | + <goals> |
| 372 | + <goal>enforce</goal> |
| 373 | + </goals> |
| 374 | + <configuration> |
| 375 | + <!-- |
| 376 | + We want to override the rules for this configuration to remove the bannedRepositories rule from the JBoss parent. |
| 377 | + --> |
| 378 | + <rules combine.self="override"> |
| 379 | + <requireJavaVersion> |
| 380 | + <message>To build this project JDK ${jdk.min.version} (or greater) is required. Please install it.</message> |
| 381 | + <version>${jdk.min.version}</version> |
| 382 | + </requireJavaVersion> |
| 383 | + </rules> |
| 384 | + </configuration> |
| 385 | + </execution> |
| 386 | + </executions> |
| 387 | + </plugin> |
| 388 | + </plugins> |
277 | 389 | </build>
|
278 | 390 |
|
| 391 | + <profiles> |
| 392 | + <profile> |
| 393 | + <id>release</id> |
| 394 | + <activation> |
| 395 | + <property> |
| 396 | + <name>performRelease</name> |
| 397 | + <value>true</value> |
| 398 | + </property> |
| 399 | + </activation> |
| 400 | + <build> |
| 401 | + <plugins> |
| 402 | + <plugin> |
| 403 | + <groupId>org.apache.maven.plugins</groupId> |
| 404 | + <artifactId>maven-gpg-plugin</artifactId> |
| 405 | + </plugin> |
| 406 | + </plugins> |
| 407 | + </build> |
| 408 | + </profile> |
| 409 | + |
| 410 | + <!-- |
| 411 | + WARNING: this MUST be the very last profile, |
| 412 | + so that the "report" module is the very last module, |
| 413 | + in particular when deploying artifacts to a Nexus repository. |
| 414 | + See the "build/reports" module POM for more information. |
| 415 | + --> |
| 416 | + <profile> |
| 417 | + <id>build-reports-as-last-module</id> |
| 418 | + <activation> |
| 419 | + <property> |
| 420 | + <name>!some.property.that.will.never.exist</name> |
| 421 | + </property> |
| 422 | + </activation> |
| 423 | + <modules> |
| 424 | + <module>reports</module> |
| 425 | + </modules> |
| 426 | + </profile> |
| 427 | + |
| 428 | + <!-- DO NOT ADD ANY PROFILE AFTER THIS: see above --> |
| 429 | + </profiles> |
| 430 | + |
279 | 431 | </project>
|
0 commit comments