Maven - How to deploy artifacts to a Maven Repository
To deploy a Java application code with source code and javadoc to a Maven Repository (like Nexus), you can use the following Maven command:
mvn deploy:deploy-file
-DgroupId=com.vianneyfaivre -DartifactId=your-artifact-id -Dversion=0.1
-DgeneratePom=true -Dpackaging=jar
-DrepositoryId=your-maven-repo
-Durl=https://your-maven-repo.com/repositories/releases
-Dfile=target/your-artifact-id-0.1.jar
-Dsources=target/your-artifact-id-0.1-sources.jar
-Djavadoc=target/your-artifact-id-0.1-javadoc.jar
The parameter repositoryId
should be defined in the section distributionManagement
of your project’ pom.xml
or in your ~/.m2/settings.xml
.
More options are listed in Maven documentation: http://maven.apache.org/guides/mini/guide-3rd-party-jars-remote.html