小编Sha*_*ram的帖子

mvn deploy:deploy-file - 无法部署工件:找不到工件

我正在尝试将第三方供应商的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/
Run Code Online (Sandbox Code Playgroud)

在我的settings.xml中使用以下条目:

  <servers>
        <server>
            <id>Nexus</id>
            <username>myusername</username>
            <password>mypassword</password>
        </server>
  </servers>
Run Code Online (Sandbox Code Playgroud)

但我得到这个错误:

[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]
Run Code Online (Sandbox Code Playgroud)

有什么建议?

一些相关信息...我可以使用此命令安装到我的本地存储库中:

mvn install:install-file 
-DgroupId=acme 
-DartifactId=acme 
-Dversion=1.0 
-Dpackaging=jar 
-Dfile=C:\tmp\acme-1.0.jar
Run Code Online (Sandbox Code Playgroud)

我还使用GAV参数通过Nexus Web界面尝试了"Artifact Upload":

Group: acme
Artifact: acme
Version: 1.0
Packaging: jar
Run Code Online (Sandbox Code Playgroud)

并选择并添加acme-1.0.jar.这很好,但项目上的"mvn install"取决于这个jar会导致:

Could not find artifact acme:acme:jar:1.0 in Nexus (http://myserver:8888/nexus/content/groups/public)
Run Code Online (Sandbox Code Playgroud)

我的pom包含:

<repositories>
  <repository> …
Run Code Online (Sandbox Code Playgroud)

nexus maven

7
推荐指数
1
解决办法
5万
查看次数

标签 统计

maven ×1

nexus ×1