Skip to content

Commit 6d319ab

Browse files
Switch publishing plugin to nexus.
1 parent 9b38eb4 commit 6d319ab

File tree

1 file changed

+129
-139
lines changed

1 file changed

+129
-139
lines changed

pom.xml

+129-139
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@
99
<!--java11.build.outputDirectory>${project.build.directory}/classes-java11</java11.build.outputDirectory -->
1010
<artifact.classifier />
1111

12-
<sonatypeOssDistMgmtSnapshotsUrl>https://oss.sonatype.org/content/repositories/snapshots/</sonatypeOssDistMgmtSnapshotsUrl>
12+
<!-- When releasing a new version, this property controls whether the staged artifacts will be automatically
13+
released in Nexus. If this is set to false (-DautoReleaseStagedArtifacts=false), artifacts will need to
14+
be manually released via the Nexus UI at https://oss.sonatype.org -->
15+
<autoReleaseStagedArtifacts>true</autoReleaseStagedArtifacts>
1316

1417
<docker.maven.plugin.fabric8.version>0.45.0</docker.maven.plugin.fabric8.version>
1518
<felix.bundle.plugin.version>5.1.1</felix.bundle.plugin.version>
@@ -54,20 +57,6 @@
5457
<tag>HEAD</tag>
5558
</scm>
5659

57-
<repositories>
58-
<repository>
59-
<id>sonatype-nexus-snapshots</id>
60-
<name>Sonatype Nexus Snapshots</name>
61-
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
62-
<releases>
63-
<enabled>false</enabled>
64-
</releases>
65-
<snapshots>
66-
<enabled>true</enabled>
67-
</snapshots>
68-
</repository>
69-
</repositories>
70-
7160
<distributionManagement>
7261
<snapshotRepository>
7362
<id>ossrh</id>
@@ -275,6 +264,104 @@
275264
</resource>
276265
</resources>
277266

267+
<pluginManagement>
268+
<plugins>
269+
<plugin>
270+
<groupId>org.apache.maven.plugins</groupId>
271+
<artifactId>maven-clean-plugin</artifactId>
272+
<version>3.2.0</version>
273+
</plugin>
274+
275+
<plugin>
276+
<groupId>org.apache.maven.plugins</groupId>
277+
<artifactId>maven-compiler-plugin</artifactId>
278+
<version>3.10.1</version>
279+
<configuration>
280+
<source>11</source>
281+
<target>11</target>
282+
<compilerArgs>-Xlint</compilerArgs>
283+
</configuration>
284+
</plugin>
285+
286+
<plugin>
287+
<groupId>org.apache.maven.plugins</groupId>
288+
<artifactId>maven-deploy-plugin</artifactId>
289+
<version>2.8.2</version>
290+
</plugin>
291+
292+
<plugin>
293+
<groupId>org.apache.maven.plugins</groupId>
294+
<artifactId>maven-gpg-plugin</artifactId>
295+
<version>3.0.1</version>
296+
</plugin>
297+
298+
<plugin>
299+
<groupId>org.apache.maven.plugins</groupId>
300+
<artifactId>maven-release-plugin</artifactId>
301+
<version>2.5.3</version>
302+
</plugin>
303+
304+
<plugin>
305+
<groupId>org.sonatype.plugins</groupId>
306+
<artifactId>nexus-staging-maven-plugin</artifactId>
307+
<version>1.6.12</version>
308+
</plugin>
309+
310+
<plugin>
311+
<groupId>org.apache.maven.plugins</groupId>
312+
<artifactId>maven-surefire-plugin</artifactId>
313+
<version>3.0.0-M8</version>
314+
<configuration>
315+
<!-- Sets the VM argument line used when unit tests are run. -->
316+
<argLine>${surefireArgLine} ${sureFireOptions11}</argLine>
317+
<reuseForks>${sureFireForks11}</reuseForks>
318+
</configuration>
319+
</plugin>
320+
321+
<plugin>
322+
<groupId>org.apache.maven.plugins</groupId>
323+
<artifactId>maven-source-plugin</artifactId>
324+
<version>3.0.1</version>
325+
<configuration>
326+
<!-- outputDirectory>/absolute/path/to/the/output/directory</outputDirectory>
327+
<finalName>filename-of-generated-jar-file</finalName -->
328+
<attach>true</attach>
329+
</configuration>
330+
<executions>
331+
<execution>
332+
<id>attach-sources</id>
333+
<goals>
334+
<goal>jar-no-fork</goal>
335+
</goals>
336+
</execution>
337+
</executions>
338+
</plugin>
339+
340+
<plugin>
341+
<groupId>org.apache.maven.plugins</groupId>
342+
<artifactId>maven-javadoc-plugin</artifactId>
343+
<version>3.6.0</version>
344+
<configuration>
345+
<show>public</show>
346+
<excludePackageNames>
347+
com.zaxxer.hikari.hibernate:com.zaxxer.hikari.metrics.*:com.zaxxer.hikari.pool:com.zaxxer.hikari.util
348+
</excludePackageNames>
349+
<attach>true</attach>
350+
<maxmemory>1024m</maxmemory>
351+
</configuration>
352+
<executions>
353+
<execution>
354+
<id>bundle-sources</id>
355+
<phase>package</phase>
356+
<goals>
357+
<goal>jar</goal>
358+
</goals>
359+
</execution>
360+
</executions>
361+
</plugin>
362+
</plugins>
363+
</pluginManagement>
364+
278365
<plugins>
279366
<plugin>
280367
<groupId>org.apache.maven.plugins</groupId>
@@ -501,116 +588,9 @@
501588
</executions>
502589
</plugin>
503590
</plugins>
504-
505-
<pluginManagement>
506-
<plugins>
507-
<plugin>
508-
<groupId>org.apache.maven.plugins</groupId>
509-
<artifactId>maven-compiler-plugin</artifactId>
510-
<version>3.8.1</version>
511-
<configuration>
512-
<source>11</source>
513-
<target>11</target>
514-
<compilerArgs>-Xlint</compilerArgs>
515-
</configuration>
516-
</plugin>
517-
518-
<plugin>
519-
<groupId>org.apache.maven.plugins</groupId>
520-
<artifactId>maven-release-plugin</artifactId>
521-
<version>${maven.release.version}</version>
522-
<configuration>
523-
<autoVersionSubmodules>true</autoVersionSubmodules>
524-
<tagNameFormat>HikariCP-@{project.version}</tagNameFormat>
525-
<arguments>-Psonatype-oss-release</arguments>
526-
</configuration>
527-
</plugin>
528-
529-
<plugin>
530-
<groupId>org.apache.maven.plugins</groupId>
531-
<artifactId>maven-surefire-plugin</artifactId>
532-
<version>3.0.0-M8</version>
533-
<configuration>
534-
<!-- Sets the VM argument line used when unit tests are run. -->
535-
<argLine>${surefireArgLine} ${sureFireOptions11}</argLine>
536-
<reuseForks>${sureFireForks11}</reuseForks>
537-
</configuration>
538-
</plugin>
539-
540-
<plugin>
541-
<groupId>org.apache.maven.plugins</groupId>
542-
<artifactId>maven-source-plugin</artifactId>
543-
<version>3.0.1</version>
544-
<configuration>
545-
<!-- outputDirectory>/absolute/path/to/the/output/directory</outputDirectory>
546-
<finalName>filename-of-generated-jar-file</finalName -->
547-
<attach>true</attach>
548-
</configuration>
549-
<executions>
550-
<execution>
551-
<id>attach-sources</id>
552-
<goals>
553-
<goal>jar-no-fork</goal>
554-
</goals>
555-
</execution>
556-
</executions>
557-
</plugin>
558-
559-
<plugin>
560-
<groupId>org.apache.maven.plugins</groupId>
561-
<artifactId>maven-javadoc-plugin</artifactId>
562-
<version>3.0.1</version>
563-
<configuration>
564-
<show>public</show>
565-
<excludePackageNames>
566-
com.zaxxer.hikari.hibernate:com.zaxxer.hikari.metrics.*:com.zaxxer.hikari.pool:com.zaxxer.hikari.util
567-
</excludePackageNames>
568-
<attach>true</attach>
569-
<maxmemory>1024m</maxmemory>
570-
</configuration>
571-
<executions>
572-
<execution>
573-
<id>bundle-sources</id>
574-
<phase>package</phase>
575-
<goals>
576-
<goal>jar</goal>
577-
</goals>
578-
</execution>
579-
</executions>
580-
</plugin>
581-
</plugins>
582-
</pluginManagement>
583591
</build>
584592

585593
<profiles>
586-
<profile>
587-
<id>release-sign-artifacts</id>
588-
<activation>
589-
<property>
590-
<name>performRelease</name>
591-
<value>true</value>
592-
</property>
593-
</activation>
594-
<build>
595-
<plugins>
596-
<plugin>
597-
<groupId>org.apache.maven.plugins</groupId>
598-
<artifactId>maven-gpg-plugin</artifactId>
599-
<version>1.6</version>
600-
<executions>
601-
<execution>
602-
<id>sign-artifacts</id>
603-
<phase>verify</phase>
604-
<goals>
605-
<goal>sign</goal>
606-
</goals>
607-
</execution>
608-
</executions>
609-
</plugin>
610-
</plugins>
611-
</build>
612-
</profile>
613-
614594
<profile>
615595
<id>felix</id>
616596
<activation>
@@ -633,23 +613,33 @@
633613
</dependency>
634614
</dependencies>
635615
</profile>
616+
636617
<profile>
637-
<id>sonatype-oss-release</id>
618+
<id>release</id>
619+
<activation>
620+
<property>
621+
<name>performRelease</name>
622+
<value>true</value>
623+
</property>
624+
</activation>
638625
<build>
639626
<plugins>
627+
<!-- For release: mvn release:perform -Darguments=-Dgpg.passphrase=PASSPHRASE
628+
With gpg2 you don't need to pass the passphrase; the GPG agent will prompt for it. -->
640629
<plugin>
641630
<groupId>org.apache.maven.plugins</groupId>
642-
<artifactId>maven-source-plugin</artifactId>
643-
<version>3.3.0</version>
631+
<artifactId>maven-gpg-plugin</artifactId>
644632
<executions>
645633
<execution>
646-
<id>attach-sources</id>
634+
<id>sign-artifacts</id>
635+
<phase>verify</phase>
647636
<goals>
648-
<goal>jar-no-fork</goal>
637+
<goal>sign</goal>
649638
</goals>
650639
</execution>
651640
</executions>
652641
</plugin>
642+
653643
<plugin>
654644
<groupId>org.apache.maven.plugins</groupId>
655645
<artifactId>maven-javadoc-plugin</artifactId>
@@ -663,19 +653,19 @@
663653
</execution>
664654
</executions>
665655
</plugin>
656+
657+
<!-- nexus-staging-maven-plugin replaces the standard maven-deploy-plugin for releases and
658+
is useful for ensuring artifacts are all-or-nothing, as well as allowing artifacts to
659+
be reviewed before they're made public -->
666660
<plugin>
667-
<groupId>org.apache.maven.plugins</groupId>
668-
<artifactId>maven-gpg-plugin</artifactId>
669-
<version>3.1.0</version>
670-
<executions>
671-
<execution>
672-
<id>sign-artifacts</id>
673-
<phase>verify</phase>
674-
<goals>
675-
<goal>sign</goal>
676-
</goals>
677-
</execution>
678-
</executions>
661+
<groupId>org.sonatype.plugins</groupId>
662+
<artifactId>nexus-staging-maven-plugin</artifactId>
663+
<extensions>true</extensions>
664+
<configuration>
665+
<autoReleaseAfterClose>${autoReleaseStagedArtifacts}</autoReleaseAfterClose>
666+
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
667+
<serverId>ossrh</serverId>
668+
</configuration>
679669
</plugin>
680670
</plugins>
681671
</build>

0 commit comments

Comments
 (0)