【发布时间】:2022-01-08 12:20:49
【问题描述】:
我最近在 Macbook M1 CPU 上安装了带有 homebrew 的 Maven 3.8.4,我的 ~/.m2/settings.xml 正确地包含了 Apache Archiva 用户名和密码。
当我执行 mvn help:effective-settings -DshowPasswords=true 命令时,我可以看到正确的 xml 内容。但是当我运行 mvn clean package 时,我会得到类似的结果
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]
当我尝试从浏览器访问https://repo.company.com/repository/internal/ 地址时,我也可以登录并正确查看工件。不仅如此,其他团队成员没有任何问题。
我还删除了 maven 并重新安装,但没有任何改变。
有什么想法吗?
【问题讨论】:
-
我也在这里stackoverflow.com/questions/41228083/… 尝试了 Robert A. Decker 的方法,但没有成功。
-
请在您的 settings.xml 中显示您的设置...
-
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"> <localRepository/> <interactiveMode/> <usePluginRegistry/> <offline/> <pluginGroups/> <mirrors/> <proxies/> <profiles/> <activeProfiles/> <servers> <server> <id>company</id> <username>user</username> <password>Password1234</password> </server> </servers> </settings>
标签: maven authentication archiva