-
Notifications
You must be signed in to change notification settings - Fork 2
Maven repository setup & release process notes
In order for consuming and releasing Sibilla snapshots, as well as using the staging repository, the local maven configuration needs to be properly setup. As you can get from the distributionManagement block in the pom.xml, the Sibilla project leverages Sonatype repositories:
<distributionManagement>
<repository>
<id>sonatype-nexus-staging</id>
<name>Sonatype Nexus Staging</name>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
</repository>
<snapshotRepository>
<id>sonatype-nexus-snapshots</id>
<name>Sonatype Nexus Snapshots</name>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>
While Sibilla releases are synched to the Maven Central Repository, the snapshots can be retrieved configuring the Sonatype repositories as follows in the local settings.xml:
<settings>
...
<profiles>
<profile>
<id>my.repositories</id>
<activation>
<property>
<name>!my.repositories.off</name>
</property>
</activation>
<repositories>
<repository>
<id>sonatype-nexus-staging</id>
<name>sonatype-nexus-snapshots</name>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>sonatype-nexus-snapshots</id>
<name>sonatype-nexus-snapshots</name>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>sonatype-nexus-staging</id>
<name>sonatype-nexus-snapshots</name>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>sonatype-nexus-snapshots</id>
<name>sonatype-nexus-snapshots</name>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
...
<servers>
<server>
<id>sonatype-nexus-snapshots</id>
<username>****</username>
<password>****</password>
</server>
<server>
<id>sonatype-nexus-staging</id>
<username>****</username>
<password>****</password>
</server>
</servers>
...
<mirrors>
<mirror>
<id>sonatype-staging-group</id>
<mirrorOf>sonatype-nexus-staging</mirrorOf>
<name>Sonatype Staging Repository Group</name>
<url>https://oss.sonatype.org/content/groups/staging</url>
</mirror>
<mirror>
<id>sonatype-snapshots-group</id>
<mirrorOf>sonatype-nexus-snapshots</mirrorOf>
<name>Sonatype Snapshots Repository Group</name>
<url>https://oss.sonatype.org/content/groups/public</url>
</mirror>
</mirrors>
</settings>
The username/password to use in the 'server' elements are those of your Sonatype JIRA account (if any) and should only be required for deploying artifacts.
The maven artifacts release implies pushing signed artifacts to Sonatype first by creating, closing and releasing a staging area. Sonatype uses a Nexus installation. The credentials for logging in the Nexus interface at https://oss.sonatype.org/index.html are the same as the Sonatype JIRA account.
Instructions / documentation is available at https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide
As a reference, the jira used for requiring the initial configuration of the project is https://issues.sonatype.org/browse/OSSRH-859
Artifacts can be automatically signed using the locally installed pgp keys through the maven-gpg-plugin which is used when the release profile is on (mvn -Prelease clean deploy)
Additional documentation regarding Maven Central Repository synch and signing artifacts: