Tuesday, February 20, 2018

Return code is: 401, ReasonPhrase: Unauthorized. Nexus Error


[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project MyWebApp: Failed to deploy artifacts: Could not transfer artifact com.mkyong:MyWebApp:war from/to maven-snapshots (http://1ip_address:8081/repository/maven-snapshots/): Failed to transfer file: http://address:8081/repository/maven-snapshots/com/mkyong/MyWebApp/1.0-SNAPSHOT/MyWebApp-1.0-20180220.175544-1.war. Return code is: 401, ReasonPhrase: Unauthorized.

you may have this issue when you try to upload artifacts into Nexus from using Maven.

Here is possible fix:

Make sure you have the below entry outside comment, it should not be in between <!-- -->

  <server>
         <id>maven-snapshots</id>
         <username>admin</username>
         <password>admin123</password>
  </server>
  <server>
         <id>maven-releases</id>
         <username>admin</username>
         <password>admin123</password>
  </server>

No comments:

Post a Comment