小编pra*_*ddy的帖子

maven没有从settings.xml中选择存储库的用户名

我在〜/ .m2/settings.xml中有这个:

<servers>
    <server>
        <username>deployment</username>
        <password>xxxxxx</password>
        <id>central</id>
    </server>
    <server>
        <username>deployment</username>
        <password>xxxxxx</password>
        <id>snapshots</id>
    </server>
</servers>
Run Code Online (Sandbox Code Playgroud)

这在我的POM中:

<distributionManagement>
  <repository>
      <id>central</id>
      <name>libs-release-local</name>
      <url>http://repo.example.com:8081/nexus/content/repositories/libs-release-local</url>
  </repository>
  <snapshotRepository>
      <id>snapshots</id>
      <name>libs-local</name>
      <url>http://repo.example.com:8081/nexus/content/repositories/libs-local</url>
  </snapshotRepository>
</distributionManagement>
Run Code Online (Sandbox Code Playgroud)

我面临的问题是工件没有部署,nexus日志显示用于进行身份验证的用户名是"匿名的".这就是它失败的原因.为什么maven没有选择settings.xml中指定的用户名/密码,我做错了什么?

此外,我尝试使用-X运行maven,DEBUG日志说它正在读取设置的正确文件:

[DEBUG] Reading global settings from /home/praddy/apache-maven-3.0.5/conf/settings.xml
[DEBUG] Reading user settings from /home/praddy/.m2/settings.xml
[DEBUG] Using local repository at /home/praddy/.m2/repository
Run Code Online (Sandbox Code Playgroud)

java deployment nexus maven

8
推荐指数
2
解决办法
5352
查看次数

标签 统计

deployment ×1

java ×1

maven ×1

nexus ×1