提交/拉取请求后如何更新Maven软件包

时间:2018-08-02 16:08:21

标签: maven maven-plugin

我正在使用一个软件包https://github.com/dhatim/fastexcel,最近在他们的仓库中有一个提交,但是版本没有在git hub的软件包的Readme(description)中更改,如何使用maven更新该软件包?

我尝试运行mvn release:update-versions,但出现此错误

enter image description here

然后我运行mvn release:update-versions -X

enter image description here

enter image description here

这是我的pom.xml

enter image description here

1 个答案:

答案 0 :(得分:1)

git repo不等于Maven库。您可以从offical maven repository下载Maven库。库的维护者在构建新版本时需要将其工件上传到中央存储库,之后您可以使用它。

要查看可用的版本,可以使用https://search.maven.org之类的Maven搜索网站。

依赖项org.dhatim:fastexcel的版本为0.9.4(与github版本相同)。

因此,开发人员似乎已经上传了该文件,但未在存储库中更正其自述文件。因此,您只需在pom.xml中使用0.9.4。

因此,请始终检查Maven搜索网站,如果缺少某些内容,则可以随时向github添加问题,以要求开发人员上传它。

也有或多或少建议使用这种可能性来获得图书馆作为解决方法: 自行签出并构建项目,然后将jar文件添加到:

  1. 类似nexus的东西作为自己的存储库托管(组织通常具有可以使用的maven代理)
  2. 将其添加到pom.xml中,作为系统作用域的依赖关系,jar必须位于系统上
  3. 在fastexcel项目上使用mvn install并将pom.xml中的版本更改为0-SNAPSHOT