|
867 | 867 | </activation>
|
868 | 868 | <build>
|
869 | 869 | <plugins>
|
870 |
| - <!-- Sign artifacts --> |
| 870 | + <!-- Use nexus plugin to directly release --> |
| 871 | + <plugin> |
| 872 | + <groupId>org.sonatype.plugins</groupId> |
| 873 | + <artifactId>nexus-staging-maven-plugin</artifactId> |
| 874 | + <version>${nexus-staging-maven-plugin.version}</version> |
| 875 | + <extensions>true</extensions> |
| 876 | + <configuration> |
| 877 | + <nexusUrl>https://oss.sonatype.org/</nexusUrl> |
| 878 | + <serverId>sonatype-joda-staging</serverId> |
| 879 | + <description>Releasing ${project.groupId}:${project.artifactId}:${project.version}</description> |
| 880 | + <keepStagingRepositoryOnCloseRuleFailure>true</keepStagingRepositoryOnCloseRuleFailure> |
| 881 | + <autoReleaseAfterClose>true</autoReleaseAfterClose> |
| 882 | + </configuration> |
| 883 | + </plugin> |
| 884 | + <!-- Create dist files --> |
| 885 | + <!-- Since we cannot sign a single file, we put everything in the deploy phase --> |
| 886 | + <!-- The standard files are signed in the verify phase and then deployed to Maven Central using nexus-staging-maven-plugin --> |
| 887 | + <!-- Then (and only then) we create and attach the dist files, sign them, and release them to GitHub Releases --> |
871 | 888 | <plugin>
|
872 | 889 | <groupId>org.apache.maven.plugins</groupId>
|
873 |
| - <artifactId>maven-gpg-plugin</artifactId> |
| 890 | + <artifactId>maven-assembly-plugin</artifactId> |
874 | 891 | <executions>
|
875 | 892 | <execution>
|
876 |
| - <id>sign-artifacts</id> |
877 |
| - <phase>verify</phase> |
| 893 | + <id>make-assembly</id> |
| 894 | + <phase>deploy</phase> |
878 | 895 | <goals>
|
879 |
| - <goal>sign</goal> |
| 896 | + <goal>single</goal> |
880 | 897 | </goals>
|
| 898 | + <configuration> |
| 899 | + <descriptors> |
| 900 | + <descriptor>src/main/assembly/dist.xml</descriptor> |
| 901 | + </descriptors> |
| 902 | + <tarLongFileMode>gnu</tarLongFileMode> |
| 903 | + </configuration> |
881 | 904 | </execution>
|
882 | 905 | </executions>
|
883 | 906 | </plugin>
|
884 |
| - <!-- Create dist files --> |
| 907 | + <!-- Sign artifacts, which now includes the dist files --> |
885 | 908 | <plugin>
|
886 | 909 | <groupId>org.apache.maven.plugins</groupId>
|
887 |
| - <artifactId>maven-assembly-plugin</artifactId> |
888 |
| - <configuration> |
889 |
| - <attach>false</attach> |
890 |
| - <descriptors> |
891 |
| - <descriptor>src/main/assembly/dist.xml</descriptor> |
892 |
| - </descriptors> |
893 |
| - <tarLongFileMode>gnu</tarLongFileMode> |
894 |
| - </configuration> |
| 910 | + <artifactId>maven-gpg-plugin</artifactId> |
895 | 911 | <executions>
|
896 | 912 | <execution>
|
897 |
| - <id>make-assembly</id> |
898 |
| - <phase>install</phase> |
| 913 | + <id>sign-artifacts</id> |
| 914 | + <phase>verify</phase> |
899 | 915 | <goals>
|
900 |
| - <goal>single</goal> |
| 916 | + <goal>sign</goal> |
| 917 | + </goals> |
| 918 | + </execution> |
| 919 | + <!-- this execution must be located after nexus-staging-maven-plugin (see comment above about ordering) --> |
| 920 | + <execution> |
| 921 | + <id>sign-dist-artifacts</id> |
| 922 | + <phase>deploy</phase> |
| 923 | + <goals> |
| 924 | + <goal>sign</goal> |
901 | 925 | </goals>
|
902 | 926 | </execution>
|
903 | 927 | </executions>
|
|
907 | 931 | <groupId>de.jutzig</groupId>
|
908 | 932 | <artifactId>github-release-plugin</artifactId>
|
909 | 933 | <version>1.4.0</version>
|
910 |
| - <configuration> |
911 |
| - <releaseName>Release v${project.version}</releaseName> |
912 |
| - <description>See the [change notes](https://www.joda.org/joda-time/changes-report.html#a${project.version}) for more information.</description> |
913 |
| - <tag>v${project.version}</tag> |
914 |
| - <overwriteArtifact>true</overwriteArtifact> |
915 |
| - <fileSets> |
916 |
| - <fileSet> |
917 |
| - <directory>${project.build.directory}</directory> |
918 |
| - <includes> |
919 |
| - <include>${project.artifactId}*-dist.tar.gz</include> |
920 |
| - <include>${project.artifactId}*-dist.zip</include> |
921 |
| - </includes> |
922 |
| - </fileSet> |
923 |
| - </fileSets> |
924 |
| - </configuration> |
925 | 934 | <executions>
|
926 | 935 | <execution>
|
927 | 936 | <id>github-releases</id>
|
928 | 937 | <phase>deploy</phase>
|
929 | 938 | <goals>
|
930 | 939 | <goal>release</goal>
|
931 | 940 | </goals>
|
| 941 | + <configuration> |
| 942 | + <releaseName>Release v${project.version}</releaseName> |
| 943 | + <description>See the [change notes](https://www.joda.org/joda-time/changes-report.html#a${project.version}) for more information.</description> |
| 944 | + <tag>v${project.version}</tag> |
| 945 | + <overwriteArtifact>true</overwriteArtifact> |
| 946 | + <fileSets> |
| 947 | + <fileSet> |
| 948 | + <directory>${project.build.directory}</directory> |
| 949 | + <includes> |
| 950 | + <include>${project.artifactId}-${project.version}-dist.tar.gz</include> |
| 951 | + <include>${project.artifactId}-${project.version}-dist.tar.gz.asc</include> |
| 952 | + <include>${project.artifactId}-${project.version}-dist.zip</include> |
| 953 | + <include>${project.artifactId}-${project.version}-dist.zip.asc</include> |
| 954 | + <include>${project.artifactId}-${project.version}.jar.asc</include> |
| 955 | + </includes> |
| 956 | + </fileSet> |
| 957 | + </fileSets> |
| 958 | + </configuration> |
932 | 959 | </execution>
|
933 | 960 | </executions>
|
934 | 961 | </plugin>
|
935 |
| - <!-- Use nexus plugin to directly release --> |
936 |
| - <plugin> |
937 |
| - <groupId>org.sonatype.plugins</groupId> |
938 |
| - <artifactId>nexus-staging-maven-plugin</artifactId> |
939 |
| - <version>${nexus-staging-maven-plugin.version}</version> |
940 |
| - <extensions>true</extensions> |
941 |
| - <configuration> |
942 |
| - <nexusUrl>https://oss.sonatype.org/</nexusUrl> |
943 |
| - <serverId>sonatype-joda-staging</serverId> |
944 |
| - <description>Releasing ${project.groupId}:${project.artifactId}:${project.version}</description> |
945 |
| - <keepStagingRepositoryOnCloseRuleFailure>true</keepStagingRepositoryOnCloseRuleFailure> |
946 |
| - <autoReleaseAfterClose>true</autoReleaseAfterClose> |
947 |
| - </configuration> |
948 |
| - </plugin> |
949 | 962 | </plugins>
|
950 | 963 | </build>
|
951 | 964 | <properties>
|
|
0 commit comments