我有一个艺术品回购,落后于基本认证.我如何配置settings.xml以允许访问?
<mirrors>
<mirror>
<id>artifactory</id>
<mirrorOf>*</mirrorOf>
<url>https://myserver.example.com/artifactory/repo</url>
<name>Artifactory</name>
</mirror>
</mirrors>
<servers>
<!--
This server configuration gives your personal username/password for
artifactory. Note that the server id must match that given in the
mirrors section.
-->
<server>
<id>Artifactory</id>
<username>someArtifactoryUser</username>
<password>someArtifactoryPassword</password>
</server>
所以服务器标签是用户的用户凭据,但是我还需要提供另一个用户/密码来通过基本认证.我该怎么办?
我建议您将服务器设置放在用户设置中,而不是全局设置.您还可以加密Maven 2.1.0中的密码,有关详细信息,请参阅 mini guide .
更新:您正在使用什么版本的Artifactory?基本认证失败了 a discussion 和 issue .这显然在2.0.7和2.1.0中被修正.
从讨论来看, workaround 似乎是通过命令行传递属性,例如.
-Dhttp.proxyHost=proxy -Dhttp.proxyPort=8080 -Dproxy.username=... -Dhttp.password=...
更新:要让Maven安装通过防火墙连接,您需要配置settings.xml的代理部分,有关这方面的指导,请参阅此 question .
Update2:您可以在服务器设置中设置其他属性,有关某些背景信息,请参阅此 blog .我没有机会测试这个,但从博客和相关的 http wagon javadoc ,似乎可以在服务器设置上设置authenticationInfo,如下所示:
<server>
<id>Artifactory</id>
<username>someArtifactoryUser</username>
<password>someArtifactoryPassword</password>
<configuration>
<authenticationInfo>
<userName>auth-user</userName>
<password>auth-pass</password>
</authenticationInfo>
</configuration>
</server>
http://stackoverflow.com/questions/1280747/accessing-an-artifactory-maven-repo-that-requires-basic-auth