gpt4 book ai didi

plugins - maven 通过 github 发布的插件在 2.2.1 中不起作用?

转载 作者:行者123 更新时间:2023-12-02 13:08:26 24 4
gpt4 key购买 nike

我有点困惑,因为在我的开发过程中,我遇到了一个问题,只能通过将 Maven 发布插件从 2.2.1 降级到 2.0-beta-9 来解决。

基本上我的项目在 github 上使用 git,所以我在 pom 中的 scm 条目就像

    scm:git:git@github.com/<username>/<projectname>.git

运行release:prepare总是失败,因为在标记时使用了此命令:

    git push git@github.com/<username> <tagname>

正如您所看到的,项目名称被省略了。

我在网上查找,最终发现this link :

这个例子使用的是 2.0-beta-9 版本,它有一个很大的区别,它没有使用 git url,而是使用了 origin!

            git push origin <tagname>

有了 origin,一切就都正常了。

不幸的是,我没有找到发布插件的标签/属性来始终使用 origin 而不是 it@github.com/

有趣的是:在标记修改后的 poms 的推送之前已完成(多模块项目)。并且使用了正确的网址。

编辑:基本上版本 2.2.1 使用 scm url 而不是“origin”是正确的,但标记操作不得从 url 中删除项目名称。

问候

最佳答案

我在使用 Maven 2.2.1 和 git 时遇到了一些类似的与 URL 相关的问题。尝试 git URL 的一些变体,例如使用“:”而不是“/”作为用户名和项目名称之间的分隔符。

更新:使用 Maven 2.2.1,我看到了如您所描述的推送到原点的情况:

git push origin <tagname>

我的 SCM 网址是:

<scm>
<developerConnection>scm:git|ssh://git@github.com/zzantozz/testbed.git</developerConnection>
</scm>

根据mvn help: effective-pom,我的发布插件是:

<plugin>
<artifactId>maven-release-plugin</artifactId>
<version>2.0</version>
</plugin>

这是:

$ mvn -version
Apache Maven 2.2.1 (r801777; 2009-08-06 14:16:01-0500)
Java version: 1.6.0_26
Java home: /home/ryan/dev/tools/jdk1.6.0_26/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux" version: "2.6.35-30-generic" arch: "amd64" Family: "unix"
enter code here

关于plugins - maven 通过 github 发布的插件在 2.2.1 中不起作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6938045/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com