将 maven 插件上传到 jFrog

Uploading a maven plugin to jFrog

我开发了一个 Maven 插件,我需要将它上传到 jFrog 以便我的团队可以使用它。当然,我可以使用 jar 并分发它,但由于这是一个严肃的项目,我们选择 jFrog 作为中央存储库。

我面临的问题有点令人困惑。如前所述,当我将闪存驱动器中的插件 (a jar) 传输给另一个队友,并将插件 运行 传输时,它运行完美,没有任何故障。然而,在将它上传到 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

我在尝试执行 mvn clean install 时检查了我的 .m2 目录,但我没有将 .jar 放入我的 .m2

我还尝试使用 <dependencies> .. </dependencies> 从 jFrog 获取 .jar 作为依赖项,并且 .jar 已按预期下载;但是,当我使用 <plugin>...</plugin> 配置将 .jar 添加为插件时,出现了同样的错误。

总而言之,我的插件在我的本地机器上工作正常(并且在我传输 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>