Java.net uses Sonatype Nexus to provide Maven repository hosting service: https://maven.java.net. You can deploy snapshots, stage releases, and promote your releases so they will be synced to Maven Central. To assure the quality of artifacts in Maven Central, all new release versions must meet some quality requirements. Once you have new a release version deployed to Nexus repository, we will help you clean up old versions and sync them into central. This document will guide you the whole process step by step.
Go to http://java.net/jira/browse/MAVEN2_REPOSITORY and create a ticket with:
We will review the ticket and prepare Nexus repository and update ticket if everything is ok.
| URL | purpose |
|---|---|
| https://maven.java.net/content/repositories/snapshots/ | repository for deploying snapshots |
| https://maven.java.net/service/local/staging/deploy/maven2/ | repository for deploying releases only |
| https://maven.java.net/content/repositories/releases/ | repository for staging promotion/release, this repository is synced to Maven Central |
| https://maven.java.net/content/groups/public/ | repository group for browsing or downloading snapshots and releases |
Please make sure you read these 2 documents before going on:
Since all artifacts synced to Maven Central must be PGP signed, so if you don't have a basic PGP environment , you will need to prepare it before moving on. This includes:
Please walk through this document for the details.
To save your configuration, we provide a java.net parent POM which you can configure your POM to inherit from:
Note that this is not a requirement. If you want, you can always copy the configurations in the parent POM and paste to your own POM.
<project>
...
<parent>
<groupId>net.java</groupId>
<artifactId>jvnet-parent</artifactId>
<version>1</version>
</parent>
...
</project>
Now you need to configure your POM's SCM element like this: (for svn,git,hg users respectively)
<!-- Subversion -->
<project>
...
<scm>
<connection>scm:svn:http://svn.java.net/svn/foo~svn/trunk</connection>
<developerConnection>scm:svn:https://svn.java.net/svn/foo~svn/trunk</developerConnection>
<url>http://java.net/projects/foo/sources/svn/trunk/show</url>
</scm>
...
</project>
Note that If you don't use the standard svn layout , you must configure tagBase of maven-release-plugin.
<!-- Git -->
<project>
...
<scm>
<connection>scm:git:git@github.com:juven/git-demo.git</connection>
<developerConnection>scm:git:git@github.com:juven/git-demo.git</developerConnection>
<url>git@github.com:juven/git-demo.git</url>
</scm>
...
</project>
<!-- Mercurial -->
<project>
...
<scm>
<connection>scm:hg:http://bitbucket.org/juven/hg-demo</connection>
<developerConnection>scm:hg:https://bitbucket.org/juven/hg-demo</developerConnection>
<url>http://bitbucket.org/juven/hg-demo</url>
</scm>
...
</project>
Note that you need to store your HTTP login so hg push will not ask for it from command line. Edit .hg/hgrc like this:
[auth] hg-demo.prefix = https://bitbucket.org/juven/ hg-demo.username = juven hg-demo.password = ******Or, more securely, use: http://pypi.python.org/pypi/mercurial_keyring
You need to configure your java.net credential in ~/.m2/settings.xml:
<settings>
...
<servers>
<server>
<id>jvnet-nexus-snapshots</id>
<username>your-java.net-id</username>
<password>your-java.net-pwd</password>
</server>
<server>
<id>jvnet-nexus-staging</id>
<username>your-java.net-id</username>
<password>your-java.net-pwd</password>
</server>
</servers>
...
</settings>
see https://docs.sonatype.org/display/Repository/Publish+Snapshots
see https://docs.sonatype.org/display/Repository/Stage+a+Release
see https://docs.sonatype.org/display/Repository/Deploy+Snapshots+and+Stage+Releases+with+Ant, and with
You will first need to close and release your staging repository: (all the steps below require you log into https://maven.java.net UI with your java.net credential)
Once staging release is done, your released artifacts will be synced to Maven Central. The sync script runs every 4 hours.
Only when you have your latest version deployed to new Nexus repository, will we clean up the old versions and sync them to Maven Central.
Please comment on your JIRA ticket and we will review the old versions. If serious problems were found, like broken POM, empty JAR, we will need your help to fix them first. After that, these artifacts will be moved to new Nexus repository and synced to Maven Central.
Please stop deploying artifacts to old java.net maven repository, we only clean up your artifacts in old repository once.