【问题标题】:maven deploying 3rd pom's without jar to nexus repositorymaven 将没有 jar 的第三个 pom 部署到 nexus 存储库
【发布时间】:2016-12-31 15:41:02
【问题描述】:

当我想将第三个 jar 部署到我的 nexus 3 存储库时,我使用以下命令:

mvn deploy:deploy-file
-Dfile=<path-to-jar>
-DpomFile=<path-to-pom>
-DrepositoryId=<id-to-map-on-server-section-of-settings.xml>
-Durl=<url-of-the-repository-to-deploy>

但此命令仅适用于带有 pom 的 jar,并且有许多工件只有 pom 而没有 jar,所以我正在寻找一种方法来仅部署没有 jar 文件的 pom。我的 maven 版本是 3.3.9

【问题讨论】:

  • 你试过没有 -Dfile 并且你的 pom 有包装 pom 吗?
  • 我的 pom 有打包 pom,当我删除 -Dfile 时出现错误 - “参数文件丢失或无效”
  • 好像你可以做 -Dfile=pom.xml 见stackoverflow.com/a/40259503/5070577
  • 当我执行 -Dfile=pom.xml 时,我需要再给命令 3 个参数:groupId、artifactId 和版本。我通过添加 -DpomFile= 和 -Dfile= 解决了这个问题,感谢您的帮助

标签: java maven maven-3 nexus


【解决方案1】:
mvn deploy:deploy-file
-DgroupId=com.xxx.xxx.xxxx
-DartifactId=xxxxx
-Dversion=x.x.x
-DgeneratePom=false
-DrepositoryId=nexus 
-Dpackaging=pom
-Dfile=D:/xxx/xxxxx-x.x.x.pom
-DpomFile=D:/xxx/xxxxx-x.x.x.pom
-Durl=http://xxx.xx.xx.xx:8081/repository/thirdparty

-Dfile,对于Maven deploy-file 是必需的。因此,您必须指定一个文件。

在这种情况下,您可以为 -DpomFile 和 -Dfile 指向同一个 pom 文件。

这适用于 Nexus OSS 版本 3.23.0-03 和 Maven 3.5.2

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-04-29
    • 2014-07-25
    • 2014-05-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-06-28
    • 2017-09-05
    相关资源
    最近更新 更多