Bum*_*Gee 76 plugins release maven jenkins
我正在尝试使用Maven 发布Jenkins插件(stashNotifier)并面临发布插件的问题.
mvn clean release:prepare
Run Code Online (Sandbox Code Playgroud)
运行完成没有错误但无法在我的本地git存储库中提交更改的pom.xml.即使它确实标记了我试图发布版本1.0.2的分支的HEAD.这是我的本地分支在准备发布之前的样子
* df60768 (HEAD, origin/develop, develop) upgraded parent pom to version 1.498
* 792766a added distribution management section to pom.xml and amended readme.md
Run Code Online (Sandbox Code Playgroud)
这就是它之后的样子
* df60768 (HEAD, tag: stashNotifier-1.0.2, origin/develop, develop) upgraded parent pom to version 1.498
* 792766a added distribution management section to pom.xml and amended readme.md
Run Code Online (Sandbox Code Playgroud)
不幸的是,pom.xml已经包含下一个开发版本,这反过来会导致后续版本:执行以释放该快照版本.
从maven的命令输出,它几乎看起来像是省略了git commit命令:
[INFO] Checking in modified POMs...
[INFO] Executing: /bin/sh -c cd /Users/gruetter/Dropbox/stashNotifier && git add -- pom.xml
[INFO] Working directory: /Users/gruetter/Dropbox/stashNotifier
[INFO] Executing: /bin/sh -c cd /Users/gruetter/Dropbox/stashNotifier && git status
[INFO] Working directory: /Users/gruetter/Dropbox/stashNotifier
[INFO] Tagging release with the label stashNotifier-1.0.2...
[INFO] Executing: /bin/sh -c cd /Users/gruetter/Dropbox/stashNotifier && git tag -F /var/folders/dr/xxbtyycs1z9dl2_snlj87zrh0000gn/T/maven-scm-678409272.commit stashNotifier-1.0.2
[INFO] Working directory: /Users/gruetter/Dropbox/stashNotifier
[INFO] Executing: /bin/sh -c cd /Users/gruetter/Dropbox/stashNotifier && git push git@github.com:jenkinsci/stashnotifier-plugin.git stashNotifier-1.0.2
[INFO] Working directory: /Users/gruetter/Dropbox/stashNotifier
[INFO] Executing: /bin/sh -c cd /Users/gruetter/Dropbox/stashNotifier && git ls-files
[INFO] Working directory: /Users/gruetter/Dropbox/stashNotifier
[INFO] Transforming 'Stash Notifier'...
[INFO] Not removing release POMs
[INFO] Checking in modified POMs...
[INFO] Executing: /bin/sh -c cd /Users/gruetter/Dropbox/stashNotifier && git add -- pom.xml
[INFO] Working directory: /Users/gruetter/Dropbox/stashNotifier
[INFO] Executing: /bin/sh -c cd /Users/gruetter/Dropbox/stashNotifier && git status
[INFO] Working directory: /Users/gruetter/Dropbox/stashNotifier
[INFO] Release preparation complete.
Run Code Online (Sandbox Code Playgroud)
我正在运行maven 3.0.5(没有--dry-run或-DpushChanges = false).以下是我有效pom的相关(我认为)部分:
[...]
<scm>
<connection>scm:git:git://github.com/jenkinsci/stashnotifier-plugin.git</connection>
<developerConnection>scm:git:git@github.com:jenkinsci/stashnotifier-plugin.git</developerConnection>
<url>https://github.com/jenkinsci/stashnotifier-plugin</url>
</scm>
[...]
<distributionManagement>
<repository>
<id>maven.jenkins-ci.org</id>
<url>http://maven.jenkins-ci.org:8081/content/repositories/releases/</url>
</repository>
<snapshotRepository>
<id>maven.jenkins-ci.org</id>
<url>http://maven.jenkins-ci.org:8081/content/repositories/snapshots</url>
</snapshotRepository>
<site>
<id>github-pages</id>
<url>gitsite:git@github.com/jenkinsci/maven-site.git:plugin-parent/stashNotifier</url>
</site>
</distributionManagement>
[...]
<properties>
[...]
<maven-release-plugin.version>2.2.2</maven-release-plugin.version>
[...]
</properties>
[...]
<build>
[...]
<pluginManagement>
<plugins>
[...]
<plugin>
<artifactId>maven-release-plugin</artifactId>
<version>2.2.2</version>
</plugin>
[...]
</pluginManagement>
[...]
<plugins>
[...]
<plugin>
<artifactId>maven-release-plugin</artifactId>
<version>2.2.2</version>
<configuration>
<goals>deploy</goals>
</configuration>
</plugin>
[...]
</plugins>
</build>
Run Code Online (Sandbox Code Playgroud)
我究竟做错了什么?提前感谢您的见解!
小智 92
我通过更新git scm提供程序依赖项而不是发布插件版本来解决我的问题(运行maven 3.0.5):
<build>
<plugins>
<plugin>
<artifactId>maven-release-plugin</artifactId>
<version>2.4.2</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.scm</groupId>
<artifactId>maven-scm-provider-gitexe</artifactId>
<version>1.8.1</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
Run Code Online (Sandbox Code Playgroud)
git scm 1.8.1版本正确地进行了git commit(使用prepare和rollback目标进行测试).
编辑:根据您的环境,可能需要不同版本的maven-release-plugin和maven-scm-provider-gitexe.有关更多讨论,请参阅注释.
vas*_*ekt 16
我遇到了同样的问题,#richnou的解决方案适合我(升级SCM依赖).有关此问题的问题,请参阅下面的链接.问题与新版本的Git有关,其中"git status"返回插件无法解析的本地化消息.这是根本原因.通过使用--porcelaingit选项(它应该返回易于解析的输出)在git scm(1.8.1版本)中修复了该问题,但是在此修复之后,又引发了另一个问题 - 如果存储库root(scm标记)不是工作目录,release:prepare仍然失败.这个问题似乎在Git SCM的快照版本中修复(尚未发布).这可以通过将scm标签复制到儿童pom中来实现.
您可能正在阅读此内容,因为上述解决方案并不适合您.我有同样的问题,我尝试了这里提到的一切.我的版本是:maven-release-plugin 2.5和git 1.7.9
该解决方案的工作对我来说是降级行家释放小插件到2.3.2版本
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<autoVersionSubmodules>true</autoVersionSubmodules>
</configuration>
</plugin>
</plugins>
</build>
Run Code Online (Sandbox Code Playgroud)
首先,richnou和vasekt的答案解决了我的问题,我认为我发布这个答案只是因为版本比我们提到的更新,我认为给出一个包含它们的额外例子会更好.
我使用Git 3.3.x运行maven release plugin 2.3.2而没有指定maven scm依赖版本,这导致了快照问题.对我来说,我刚刚升级到maven发布插件和scm依赖项的最新版本,如下所示:
<plugin>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.3</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.scm</groupId>
<artifactId>maven-scm-provider-gitexe</artifactId>
<version>1.9.5</version>
</dependency>
</dependencies>
</plugin>
Run Code Online (Sandbox Code Playgroud)
这对我来说很好,发布版本正确上传到发布回购,快照也按预期工作.
我刚刚遇到了同样的问题,从其他答案和评论中,我认为这可能是发布插件本身的错误。
就我而言,我在一个新的且大部分是空的项目中使用 git 版本的插件 2.4,结构如下:
my-repo.git/
module-parent/ # running the release from here
(module-child-1/) # except I hadn't created it yet
(module-child-2/) # except I hadn't created it yet
Run Code Online (Sandbox Code Playgroud)
(这个项目的源代码可以在这里看到,在解决问题之前:我的项目也有同样的问题。)
查看maven-release-plugin:2.4.1 的发行说明,似乎 MRELEASE-830 有机会解决这个问题。
我不确定这是否确实是问题所在,但将我的项目升级到插件的 2.4.1 版本为我解决了这个问题。希望它也能解决您的问题!
| 归档时间: |
|
| 查看次数: |
33343 次 |
| 最近记录: |