Deploying artifacts in nexus from maven gives error Return code is: 401 ReasonPhrase: Unauthorized

3.6k Views Asked by At

While Deploying I am getting the below message

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy (default-deploy) on project gameoflife: Failed to deploy artifacts: Could not transfer artifact com.wakaleo.gameoflife:gameoflife:pom:1.0-20180129.123439-1 from/to game-snapshots (http://localhost:8081/nexus/content/repositories/game-snapshots/): Failed to transfer file: http://localhost:8081/nexus/content/repositories/game-snapshots/com/wakaleo/gameoflife/gameoflife/1.0-SNAPSHOT/gameoflife-1.0-20180129.123439-1.pom. Return code is: 401, ReasonPhrase: Unauthorized. -> [Help 1]

I have added the credentials in .m2 settings.xml but I am getting the error message again

2

There are 2 best solutions below

0
On BEST ANSWER

This could be:

  • your settings.xml is not found
  • your credentials are wrong
  • your credentials have not the proper rights in your Nexus
1
On
  1. Please, check your system proxy once. There may be firewall block to access the specified Nexus url to upload an any file.

  2. Second in settings.xml file, please give proxy details.