【发布时间】:2013-04-25 15:38:05
【问题描述】:
我正在尝试将第 3 方供应商的 jar 添加到我们的内部 nexus 存储库。
我已尝试使用此命令:
mvn deploy:deploy-file
-DgroupId=acme
-DartifactId=acme
-Dversion=1.0
-Dpackaging=jar
-Dfile=C:\tmp\acme-1.0.jar
-DrepositoryId=Nexus
-Durl=http://myserver:8888/nexus/content/repositories/thirdparty/
在我的 settings.xml 中有以下条目:
<servers>
<server>
<id>Nexus</id>
<username>myusername</username>
<password>mypassword</password>
</server>
</servers>
但我收到此错误:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:
deploy-file (default-cli) on project standalone-pom: Failed to deploy artifacts:
Could not find artifact acme:acme:jar:1.0 in Nexus (http://myserver:8888/nexus/c
ontent/repositories/thirdparty) -> [Help 1]
有什么建议吗?
一些相关信息... 我可以安装到我的本地存储库,使用这个命令:
mvn install:install-file
-DgroupId=acme
-DartifactId=acme
-Dversion=1.0
-Dpackaging=jar
-Dfile=C:\tmp\acme-1.0.jar
我还尝试了通过 Nexus Web 界面使用 GAV 参数“上传工件”:
Group: acme
Artifact: acme
Version: 1.0
Packaging: jar
然后选择并添加 acme-1.0.jar。 这可以很好地完成,但是根据这个 jar 对项目进行“mvn install”会导致:
Could not find artifact acme:acme:jar:1.0 in Nexus (http://myserver:8888/nexus/content/groups/public)
我的 pom 包含:
<repositories>
<repository>
<id>Nexus</id>
<url>http://myserver:8888/nexus/content/groups/public</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
非常感谢任何帮助...
PS 我知道这个问题与this one 非常相似,但问题似乎是使用了 jenkins url,而不是 nexus url。
【问题讨论】: