【发布时间】: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= 解决了这个问题,感谢您的帮助