Search code examples
mavenauthenticationarchiva

I have a problem with Maven 3.8.4 that not allowed to authorize our private repo on Apache Archiva


I have installed Maven 3.8.4 with homebrew on Macbook M1 CPU recently and I have ~/.m2/settings.xml properly containing the Apache Archiva user name and password.

when I executed mvn help:effective-settings -DshowPasswords=true command I can see the correct xml content. But when I run mvn clean package I get something like that

Failed to read artifact descriptor for company.webshop:webshop-common:jar:21.11.12:
 Could not transfer artifact company.webshop:webshop-common:pom:21.11.12 
from/to company (https://repo.company.com/repository/internal/): 
authorization failed for https://repo.company.com/repository/internal/company/webshop/webshop-
common/21.11.12/webshop-common-21.11.12.pom,
 status: 403 Forbidden -> [Help 1]

when I try to access https://repo.company.com/repository/internal/ address from my browser I can login and see the artifacts properly as well. More than that other team members don't live any problem.

I also removed maven and reinstalled but nothing changed.

any idea?


Solution

  • I noticed that after removing the folders (under the .m2 folder) related to our private repo, and re-run the maven after a fresh instalment it's working properly.

    Maven was not downloading the artifacts I guess, since there is a folder of that version number and only showing the content of old files which says something like "not authorized to the repo." and was miss leading