Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deploy from Maven to Nexus got error: ReasonPhrase:Forbidden

Tags:

maven

nexus

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.

like image 691
user2784896 Avatar asked Feb 14 '23 01:02

user2784896


2 Answers

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.

like image 182
Eddú Meléndez Avatar answered Feb 27 '23 11:02

Eddú Meléndez


Richard Seddon resolved my issue in nexus-users group.

Add this to nonProxyHosts: localhost

like image 30
user2784896 Avatar answered Feb 27 '23 11:02

user2784896