Skip to content

Commit

Permalink
chore: make POM ready for deployment to Maven Central
Browse files Browse the repository at this point in the history
This commit basically follows the guidelines outlined [here][1]:

* Update the SCM section.
* Add a new developer ([email protected], PGP key ID BE65F50D) as
  developer to this project.
* Create a `release` profile that will attach the source code, generate
  javadoc and sign the artifacts with the private key of the releaser.
  This is in a separate profile because these tasks take time and are
  only necessary when releasing to Maven Central.

When releasing in the future, these are the steps to follow:

* Develop
* Commit any outstanding changes
* Run tests, make sure build passes
* Update versions to release version
* Commit release version
* Run deployment
* Update versions to next snapshot version
* Commit new snapshot version
* Develop, develop, develop and rinse and repeat

[1]: <https://central.sonatype.org/publish/publish-guide/>
  • Loading branch information
svandenakker committed Apr 8, 2024
1 parent e613b72 commit 97f5b5b
Showing 1 changed file with 96 additions and 32 deletions.
128 changes: 96 additions & 32 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@
</licenses>

<scm>
<url>https://github.com/bolcom/cryptvault</url>
<connection>https://github.com/bolcom/cryptvault</connection>
<url>https://github.com/bolcom/cryptvault/tree/master</url>
<connection>scm:git:https://github.com/bolcom/cryptvault.git</connection>
<developerConnection>scm:git:ssh://github.com/bolcom/cryptvault.git</developerConnection>
</scm>

<developers>
Expand All @@ -30,7 +31,14 @@
<email>[email protected]</email>
<organization>bol.com</organization>
<timezone>1</timezone>
<organizationUrl>http://bol.com</organizationUrl>
<organizationUrl>https://bol.com</organizationUrl>
</developer>
<developer>
<name>Stefan van den Akker</name>
<email>[email protected]</email>
<organization>bol.com</organization>
<timezone>1</timezone>
<organizationUrl>https://bol.com</organizationUrl>
</developer>
</developers>

Expand Down Expand Up @@ -77,35 +85,91 @@
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.3</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<additionalparam>-Xdoclint:none</additionalparam>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

<profiles>
<!-- release with: export GPG_TTY=$(tty); mvn versions:set -DnewVersion=1.2.3 && mvn clean deploy -P release -->
<profile>
<id>release</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.3</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<additionalparam>-Xdoclint:none</additionalparam>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
<configuration>
<!-- create profile in your ~/.m2/settings.xml that contains gpg.keyname + short key ID as property -->
<!-- e.g. <settings><profiles><profile><activation><activeByDefault>true</activeByDefault></activation><properties><gpg.keyname>BE65F50D</gpg.keyname> etc. -->
<keyname>${gpg.keyname}</keyname>
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.13</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>false</autoReleaseAfterClose>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
</project>

0 comments on commit 97f5b5b

Please sign in to comment.