Skip to content

Commit 2545c2e

Browse files
authored
Merge pull request #920 from josemduarte/improve-mvn-release
Improve mvn release process
2 parents 1d73a18 + fce9a51 commit 2545c2e

1 file changed

Lines changed: 91 additions & 108 deletions

File tree

pom.xml

Lines changed: 91 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -218,9 +218,6 @@
218218
<!-- work around for GPG hanging issue http://jira.codehaus.org/browse/MGPG-9 -->
219219
<mavenExecutorId>forked-path</mavenExecutorId>
220220

221-
<!-- needed for jenkins release plugin -->
222-
<useReleaseProfile>true</useReleaseProfile>
223-
<arguments>-Pgpg-release</arguments>
224221
</configuration>
225222

226223
</plugin>
@@ -339,35 +336,6 @@
339336

340337
<plugins>
341338

342-
<!-- for deployment on OSS Sonatype -->
343-
<plugin>
344-
<groupId>org.sonatype.plugins</groupId>
345-
<artifactId>nexus-staging-maven-plugin</artifactId>
346-
<version>1.6.8</version>
347-
<extensions>true</extensions>
348-
<configuration>
349-
<serverId>ossrh</serverId>
350-
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
351-
<autoReleaseAfterClose>true</autoReleaseAfterClose>
352-
</configuration>
353-
</plugin>
354-
355-
<!-- for digital signing of code -->
356-
<!--<plugin> -->
357-
<!--<groupId>org.apache.maven.plugins</groupId> -->
358-
<!--<artifactId>maven-gpg-plugin</artifactId> -->
359-
<!--<version>1.5</version> -->
360-
<!--<executions> -->
361-
<!--<execution> -->
362-
<!--<id>sign-artifacts</id> -->
363-
<!--<phase>verify</phase> -->
364-
<!--<goals> -->
365-
<!--<goal>sign</goal> -->
366-
<!--</goals> -->
367-
<!--</execution> -->
368-
<!--</executions> -->
369-
<!--</plugin> -->
370-
371339
<!-- give more memory for junit tests -->
372340
<plugin>
373341
<groupId>org.apache.maven.plugins</groupId>
@@ -379,7 +347,6 @@
379347
</configuration>
380348
</plugin>
381349

382-
383350
<plugin>
384351
<groupId>org.apache.maven.plugins</groupId>
385352
<artifactId>maven-jar-plugin</artifactId>
@@ -403,7 +370,6 @@
403370

404371
</plugin>
405372

406-
407373
<plugin>
408374
<groupId>org.codehaus.mojo</groupId>
409375
<artifactId>findbugs-maven-plugin</artifactId>
@@ -418,49 +384,6 @@
418384
</configuration>
419385
</plugin>
420386

421-
<!-- code coverage plugin -->
422-
<!-- coveralls/cobertura seems outdated and has many problems, I think we need to use a different plugin. Commenting out - JD 2018-03-16 -->
423-
<!--<plugin>-->
424-
<!--<groupId>org.eluder.coveralls</groupId>-->
425-
<!--<artifactId>coveralls-maven-plugin</artifactId>-->
426-
<!--<version>4.2.0</version>-->
427-
<!--&lt;!&ndash;<configuration>&ndash;&gt;-->
428-
<!--&lt;!&ndash;<repoToken>YOURTOKENGOESHERE</repoToken>&ndash;&gt;-->
429-
<!--&lt;!&ndash;</configuration>&ndash;&gt;-->
430-
<!--</plugin>-->
431-
<!--<plugin>-->
432-
<!--<groupId>org.codehaus.mojo</groupId>-->
433-
<!--<artifactId>cobertura-maven-plugin</artifactId>-->
434-
<!--<version>2.7</version>-->
435-
<!--<configuration>-->
436-
<!--<check>true</check>-->
437-
<!--<format>xml</format>-->
438-
<!--<maxmem>256m</maxmem>-->
439-
<!--&lt;!&ndash; aggregated reports for multi-module projects &ndash;&gt;-->
440-
<!--<aggregate>true</aggregate>-->
441-
442-
<!--<instrumentation>-->
443-
<!--<excludes>-->
444-
<!--<exclude>org/biojava/nbio/structure/io/mmcif/MMCIFFileTools.class</exclude>-->
445-
<!--<exclude>org/biojava/nbio/structure/symmetry/utils/SymmetryTools.class</exclude>-->
446-
<!--<exclude>demo/DemoFATCAT.class</exclude>-->
447-
<!--<exclude>org/biojava/nbio/structure/align/ce/CECalculator.class</exclude>-->
448-
<!--</excludes>-->
449-
<!--<ignores>-->
450-
<!--<ignore>org.biojava.nbio.structure.io.mmcif.MMCIFFileTools*</ignore>-->
451-
<!--<ignore>demo.*</ignore>-->
452-
<!--</ignores>-->
453-
<!--</instrumentation>-->
454-
<!--</configuration>-->
455-
<!--<executions>-->
456-
<!--<execution>-->
457-
<!--<goals>-->
458-
<!--<goal>clean</goal>-->
459-
<!--</goals>-->
460-
<!--</execution>-->
461-
<!--</executions>-->
462-
<!--</plugin>-->
463-
464387
</plugins>
465388

466389
<extensions>
@@ -471,8 +394,6 @@
471394
</extension>
472395
</extensions>
473396

474-
475-
476397
</build>
477398

478399
<dependencyManagement>
@@ -589,12 +510,103 @@
589510
</plugins>
590511
</reporting>
591512

513+
<!-- https://central.sonatype.org/pages/apache-maven.html -->
514+
<!-- https://github.com/chhh/sonatype-ossrh-parent/blob/master/pom.xml -->
515+
<distributionManagement>
516+
<snapshotRepository>
517+
<id>ossrh</id>
518+
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
519+
</snapshotRepository>
520+
<repository>
521+
<id>ossrh</id>
522+
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
523+
</repository>
524+
</distributionManagement>
592525

593526
<profiles>
527+
<profile>
528+
<!-- This is the profile needed for release, e.g.:
529+
mvn -Prelease release:clean release:prepare
530+
mvn -Prelease release:perform
531+
-->
532+
<id>release</id>
533+
<build>
534+
<plugins>
535+
<!-- for deployment on OSS Sonatype -->
536+
<!-- handles propagating the build to the staging repository -->
537+
<plugin>
538+
<groupId>org.sonatype.plugins</groupId>
539+
<artifactId>nexus-staging-maven-plugin</artifactId>
540+
<version>1.6.8</version>
541+
<extensions>true</extensions>
542+
<configuration>
543+
<serverId>ossrh</serverId>
544+
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
545+
<autoReleaseAfterClose>true</autoReleaseAfterClose>
546+
</configuration>
547+
</plugin>
548+
549+
<!-- for code signing -->
550+
<plugin>
551+
<groupId>org.apache.maven.plugins</groupId>
552+
<artifactId>maven-gpg-plugin</artifactId>
553+
<version>1.6</version>
554+
<executions>
555+
<execution>
556+
<id>sign-artifacts</id>
557+
<phase>verify</phase>
558+
<goals>
559+
<goal>sign</goal>
560+
</goals>
561+
<configuration>
562+
<!-- This is necessary for gpg to not try to use the pinentry programs -->
563+
<gpgArguments>
564+
<arg>--pinentry-mode</arg>
565+
<arg>loopback</arg>
566+
</gpgArguments>
567+
</configuration>
568+
</execution>
569+
</executions>
570+
</plugin>
571+
572+
<!-- create source -->
573+
<plugin>
574+
<groupId>org.apache.maven.plugins</groupId>
575+
<artifactId>maven-source-plugin</artifactId>
576+
<version>3.2.0</version>
577+
<executions>
578+
<execution>
579+
<id>attach-sources</id>
580+
<goals>
581+
<goal>jar-no-fork</goal>
582+
</goals>
583+
</execution>
584+
</executions>
585+
</plugin>
586+
587+
<!-- create javadoc -->
588+
<plugin>
589+
<groupId>org.apache.maven.plugins</groupId>
590+
<artifactId>maven-javadoc-plugin</artifactId>
591+
<version>3.2.0</version>
592+
<executions>
593+
<execution>
594+
<id>attach-javadocs</id>
595+
<goals>
596+
<goal>jar</goal>
597+
</goals>
598+
</execution>
599+
</executions>
600+
</plugin>
601+
602+
</plugins>
603+
</build>
604+
</profile>
594605

595606
<!-- Note: before you can use this build profile you need to set up an
596607
environment that contains correctly signed keys. Configure the keystore properties
597608
and the profile in ~/.m2/settings.xml -->
609+
<!-- Note: as of March 2021 I'm not sure what this profile is needed for. I don't think it is needed for releases, perhaps for automated snapshot builds? - JD 2021 -->
598610
<profile>
599611
<id>codesigning</id>
600612
<activation>
@@ -636,35 +648,6 @@
636648
</configuration>
637649
</plugin>
638650

639-
640-
</plugins>
641-
</build>
642-
</profile>
643-
644-
<profile>
645-
<id>release-sign-artifacts</id>
646-
<activation>
647-
<property>
648-
<name>performRelease</name>
649-
<value>true</value>
650-
</property>
651-
</activation>
652-
<build>
653-
<plugins>
654-
<plugin>
655-
<groupId>org.apache.maven.plugins</groupId>
656-
<artifactId>maven-gpg-plugin</artifactId>
657-
<version>1.6</version>
658-
<executions>
659-
<execution>
660-
<id>sign-artifacts</id>
661-
<phase>verify</phase>
662-
<goals>
663-
<goal>sign</goal>
664-
</goals>
665-
</execution>
666-
</executions>
667-
</plugin>
668651
</plugins>
669652
</build>
670653
</profile>

0 commit comments

Comments
 (0)