【发布时间】:2019-09-18 09:03:57
【问题描述】:
如何向我的私有 maven 存储库中的 jar 添加依赖项?
我有一个私有的 nexus 存储库,比如:https://localhost/repository/my-team/
在一个项目中,我生成、编译并将一些 java 类打包到一个 jar 中。比如说my.jar。
然后我把它作为一个jar上传到nexus:
curl --upload-file my.jar \
"https://localhost/repository/my-team/com/example/artifact/my.jar"
在另一个项目中,我想将此 jar 称为依赖项:
<repositories>
<repository>
<id>nexus</id>
<url>https://localhost/repository/my-team/</url>
</repository>
</repositories>
在这种情况下如何添加依赖项?我在哪里指定该 jar 文件的 url?
【问题讨论】:
-
使用 Maven 构建您的 jar 文件并将它们上传到 Nexus ...它更容易...不要通过 curl 等进行 ti。
标签: java maven dependencies nexus