Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

maven Could not transfer artifact, Not authorized, ReasonPhrase:Unauthorized

Tags:

java

maven

I added below dependency in pom.xml file:

<dependency>
  <groupId>org.tuckey</groupId>
  <artifactId>urlrewritefilter</artifactId>
  <version>4.0.4</version>
</dependency>

I have alot of maven dependencies but when I add the one above I get:

Failed to read artifact descriptor for org.tuckey:urlrewritefilter:jar:4.0.4: Could not transfer artifact org.tuckey:urlrewritefilter:pom:4.0.4 from/to central (http://app1.stage.server.net/artifactory/libs-release): Not authorized, ReasonPhrase:Unauthorized. -> [Help 1]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

this is how the settings.xml file looks:

..
  <servers>
    <server>
      <username>user</username>
      <id>central</id>
      <password>my-password</password>
    </server>
    <server>
      <username>user</username>
      <id>snapshots</id>
      <password>my-password</password>
    </server>
  </servers>
  <profiles>
    ...
  </profiles>
  <activeProfiles>
    <activeProfile>artifactory</activeProfile>
  </activeProfiles>
..

any help? tnx.

like image 220
tokhi Avatar asked Oct 04 '13 08:10

tokhi


3 Answers

Please check access of repository or password which had given in settings.xml

like image 149
Atul Jain Avatar answered Sep 19 '22 21:09

Atul Jain


I faced this issue when my proxy server was not configured correctly for maven. You should check with your network administrator about proxy server and add the it in settings.xml under conf dir.

You can look for <proxies> tag and update the fields.

When I face this issue, I too felt it happened for just a few jars, but then all other required jar files were already present in my local repository and hence I was getting it for a few jars only.

like image 5
Ujjwal Avatar answered Nov 08 '22 06:11

Ujjwal


I had this error trying to deploy to an internal instance of Nexus with a Maven client that was using proxies with no settings. Attempting to access a Nexus instance on the LAN via a proxy resulted in the Not authorized, ReasonPhrase:Unauthorized error.

<nonProxyHosts>internal.hostname</nonProxyHosts> fixed the issue.

like image 1
Phyxx Avatar answered Nov 08 '22 05:11

Phyxx