Search code examples
mavenbuildbuild-processnexus

Maven - Install an artifact to the Nexus repository


I have a problem currently when i run the command mvn install, the artifact is installed in my local repository (i.e. in %HOME/.m2 folder) but not in the Nexus repository.

I know with Nexus i can add an artifact manually using the GUI but is there a way to do install the artifact as part of the mvn command?


Solution

  • What you're seeing is normal behavior in the standard maven lifecycle. The install phase is only supposed to install the artifact locally. You need to run deploy, which comes after install. That's when maven uploads artifacts to a remote repository. The remote repo for deployment is configured in the distribution management section of the pom.