11

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.

tokhi
  • 21,044
  • 23
  • 95
  • 105
  • I have not seen this particular message myself, but the error indicates that you are trying to use your server for retrieving packages using a user where you are properly authenticated but according to the server not authorized to use this service. Check with your server admin to make sure that the user you are using is supposed to be able to use your server and that it is fact correctly configured to do so. – DanielBarbarian Oct 04 '13 at 09:08
  • 1
    yeah.. its working fine, because I have added around 100 dependencies and they all work fine, I only have the issue with this one specifically. – tokhi Oct 04 '13 at 09:15
  • This was a configuration issue on the maven server. – tokhi Oct 29 '13 at 10:32
  • 1
    What was the configuration issue? I have the same symptoms. One artifact out of hundreds will not copy from my remote repository. I can purge my local repo, and download a few hundred artifacts through our Nexus repository proxy, but one of them will fail exactly as described here with "not authorized, ReasonPhrase:Unauthorized". I can log into the web UI for the repository and download it fine manually. – Scott Carey Jul 11 '14 at 20:15
  • see also http://stackoverflow.com/questions/10911287/maven-error-not-authorized-reasonphraseunauthorized – rogerdpack Sep 16 '16 at 21:37

6 Answers6

5

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.

Ujjwal
  • 603
  • 12
  • 23
1

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.

Phyxx
  • 15,730
  • 13
  • 73
  • 112
1

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

Atul Jain
  • 1,035
  • 2
  • 16
  • 24
1

Adding this in case it helps someone else. In my case I was receiving this error and none of the solutions I found seemed to help. In the end I needed to add the config option to settings.xml to set interactiveMode to false.

Steve
  • 11
  • 2
0

If you are sure that your mirror links are configured properly in the settings.xml file, then please try this:

  1. Navigate to .m2 -> repositories
  2. Search for "lastupdated"
  3. Delete all the files that come in the search result.
  4. Then do a 'mvn clean install' -> new 'lastupdated' files would be created.
Dharman
  • 30,962
  • 25
  • 85
  • 135
-1

Try to changes groupId for the dependencies which you have added. It work

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jun 25 '22 at 06:59