4
votes

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.

3

3 Answers

4
votes

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.

4
votes

Richard Seddon resolved my issue in nexus-users group.

Add this to nonProxyHosts: localhost

0
votes

You need to be authorized to run deployment. This is done by having the server section in your settings.xml. Check out the Nexus eval guide, specifically the publishing section and the sample projects in there for more detail.