Maven – Deploy from Maven to Nexus got error: ReasonPhrase:Forbidden

mavennexus

http://numberformat.wordpress.com/2011/05/18/nexus-repository/

I am following the above link to setup Maven and Nexus, everything new. I couldn't left a new comment there so I post here.

After so long, I am in another company, when I tried to setup a simple sample in my local PC, I got this error in "mvn deploy" to the simple Maven my-app sample. I installed the simple Nexus Open Source w/o Tomcat.

[WARNING] Could not transfer metadata com.mycompany.app:my-app:1.0-SNAPSHOT/maven-metadata.xml from/to snapshots (localhost:8081/nexus/content/repositories/snapshots): Access denied to: localhosts:8081/nexus/content/repositories/snapshots/com/mycompany/app/my-app/1.0-SNAPSHOT/maven-metadata.xml , ReasonPhrase:Forbidden.

Best Answer

In your settings.xml located in MAVEN_HOME/conf you have to add in servers section

<server>
  <id>nexus-releases</id>
  <username>deploy</username>
  <password>123456</password>
</server>

And in your pom must looks like

<distributionManagement>
   <repository>
    <id>nexus-releases</id>
    <url>http://localhost:8081/nexus/content/repositories/releases</url>
   </repository>
</distributionManagement>

Ids have to be the same.

Related Topic