java - 将 maven 插件上传到 jFrog
问题描述
我已经开发了一个 Maven插件,我需要将它上传到 jFrog 以便我的团队可以使用它。当然,我可以使用jar
并分发它,但由于它是一个严肃的项目,我们选择 jFrog 作为中央存储库。
我面临的问题有点令人困惑。如前所述,当我将jar
闪存驱动器中的插件 (a) 转移给另一个队友并运行该插件时,它运行良好,没有任何故障。但是,将其上传到 jFrog 后,在尝试运行插件时出现此错误。
[ERROR] Plugin com.XXXX:XXXX:1.0 or one of its dependencies could not be resolved: Failure to find com.XXXX:XXX:jar:1.0 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
.m2
我在尝试做 a 时检查了我的目录,但mvn clean install
我没有.jar
进入我的.m2
.
我还尝试使用.jar
从 jFrog 作为依赖项获取<dependencies> .. </dependencies>
,并且.jar
按预期下载了;但是,当我.jar
使用配置将其添加为插件时<plugin>...</plugin>
,出现了同样的错误。
总而言之,我的插件在我的本地机器上运行良好(当我传输 jar 而不将其上传到 jFrog 时运行良好)但在尝试.jar
从 jFrog 下载并尝试在此后执行它时出现此错误。
如果有人可以帮助我,那将是一个很大的帮助。
解决方案
在配置额外的 maven 存储库时,对于 maven 依赖项,使用如下配置,
<repositories>
<repository>
<id>repo-id</id>
<url>repository-url</url>
</repository>
</repositories>
对于 maven 插件,必须添加单独的配置pom.xml
才能运行远程存储库插件。
<pluginRepositories>
<pluginRepository>
<id>repo-id</id>
<url>repository-url</url>
</pluginRepository>
</pluginRepositories>
推荐阅读
- vuejs2 - vue-native 和 nativescript-vue 哪个更好?
- python - 如何在python中将数组的元素与JSON数组的元素匹配
- codeigniter - 如何添加警报以登录我的登录页面,例如“登录成功”?
- zapier - 如何自动回复 Gmail 电子邮件
- oracle - Oracle - 加入 2 个时间段
- jquery - 如何减少变量的值?
- angular - 在 Angular 中,我想获取一些 div 但纯 html 元素而不是自定义元素的 html 如何实现这一点?
- android - SQLite 给出空指针
- linux - PowerShell 中的 grep 和 sed 等效项
- angular - Ionic3 ActionSheet:如何使用来自 Fontawesome 的自定义图标?