Skip to main content

Maven 2 repository for java.net projects

The Maven 2 repository for hosting java.net projects libraries and dependencies is no longer active. This page documents how to use the new maven.java.net repository. Please follow the instructions here to deploy to maven.java.net.

POM Clean-up

You will need to clean-up your pom so that any references to the old maven2 repository are removed. The artifacts that were in Maven 2 repository (download.java.net/maven/2) have been migrated to Maven Central. The list of things to remove from the pom file is documented here.

PUBLIC and SNAPSHOT Repository

Only released artifacts are sync'd to Maven Central. If you would like to reference SNAPSHOT artifacts, there are two options:

  1. Option 1:
    In $MAVEN_HOME/.m2/settings.xml, add a profile referencing the PUBLIC repository (https://maven.java.net/content/groups/public/). The PUBLIC repository contains both snapshots and releases. By providing the PUBLIC repository, you don't need to wait for the released artifacts to sync'd to Maven Central. Your build will be able to download released and snapshot artifacts from the PUBLIC repository. If you want to specify just the snapshots, you could reference the SNAPSHOT repository (https://maven.java.net/content/repositories/snapshots/).
    <profiles>
    <profile>
    <id>maven-repository</id>
    <activation>
    <activeByDefault>true</activeByDefault>
    </activation>
    <repositories>
    <repository>
    <id>java.net-Public</id>
    <name>Maven Java Net Snapshots and Releases</name>
    <url>https://maven.java.net/content/groups/public/</url>
    </repository>
    </repositories>
    <pluginRepositories>

    </pluginRepositories>

    </profile>
    </profiles
    If <activateByDefault>true</activateByDefault> is specified, the profile is activated by default. You do not need to provide the profile on the command line. If <activateByDefault>false</activeByDefault>, then you will need to provide the profile on the command line: “mvn -Pmaven-repository install”.
  1. Option 2:
    Add reference to PUBLIC or SNAPSHOT repository in the pom file:
    <repositories>
    <repository>
    <id>java.net-Public</id>
    <name>Maven Java Net Snapshots and Releases</name>
    <url>https://maven.java.net/content/groups/public/</url>
    <updatePolicy>never</updatePolicy>
    </repository>
    </repositories>


RELEASE Repository

The released artifacts are available in RELEASE and PUBLIC repositories. The PUBLIC repository contains both snapshots and releases while RELEASE repository (https://maven.java.net/content/repositories/releases/) only contains released version. If you prefer to have your project depend only on released version, then reference the RELEASE repository in the pom file. This will prevent any integration of snapshot versions in your project. However, developers may want to reference snapshots during development or unit testing and instead of modifying the pom file, developers can add a profile referencing the SNAPSHOT or PUBLIC repository in their settings.xml file (see option 1 above).

STAGING Repository

If you're not quite yet ready to release the artifacts and do not want the artifacts to sync to Maven Central, you could reference the staging repository. After successfully deploying the artifacts to maven.java.net, you need to first close the repository so artifacts are moved to the staging repository. See instructions here to close artifacts to the staging repository. After closing the repository, the artifacts will be available in https://maven.java.net/content/repositories/staging/. You could set this URL in the repository element in $MAVEN_HOME/.m2/settings.xml to test the artifact before closing the artifacts to the release repository. See option 1 above for specifying the repository in settings.xml file. If you don't want to release the artifact to Maven Central, you could drop the artifacts in the staging repository and redeploy. See instructions here to drop artifacts in the staging repository. Keep in mind that once the artifact is released and sync'd to Maven Central, you cannot redeploy the same version again. The staging repository is very helpful when you want to test the promoted artifacts before actually releasing to Maven Central.

Maven Java dot Net Repositories

Here's the list of repositories on maven.java.net that you could reference in settings.xml or pom:

Repository URL
PUBLIC (contains both snapshots and releases) https://maven.java.net/content/repositories/public/
SNAPSHOT https://maven.java.net/content/repositories/snapshots/
RELEASE https://maven.java.net/content/repositories/releases/
STAGING https://maven.java.net/content/repositories/staging/



For any questions, please e-mail us at: users@maven2-repository.java.net

 
 
Close
loading
Please Confirm
Close