Maven error: Not authorized, ReasonPhrase:Unauthorized

Mahendra Liya picture Mahendra Liya · Jun 6, 2012 · Viewed 115.3k times · Source

I checked out my code from the Nexus repository repository. I changed the password for my account and set it correctly inside my settings.xml file. While executing mvn install clean I get the error saying Not authorized, ReasonPhrase:Unauthorized when it tries to download files from that repository.

Any idea how to solve this error? I am using Windows 7 with Maven 3.04

Answer

blacelle picture blacelle · Jun 6, 2012

The issue may happen while fetching dependencies from a remote repository. In my case, the repository did not need any authentication and it has been resolved by removing the servers section in the settings.xml file:

<servers>
    <server>
      <id>SomeRepo</id>
      <username>SomeUN</username>
      <password>SomePW</password>
    </server>
</servers>

ps: I guess your target is mvn clean install instead of maven install clean