我试图发布一个詹金斯插件(StashNotifier)与 Maven 和面临的问题与发布插件。
mvn clean release:prepare
在没有错误的情况下运行到完成,但是未能在我的本地 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
这就是之后的样子
* 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
不幸的是,pom.xml 已经包含了下一个开发版本,这反过来又导致了后续的版本: operation 来发布快照版本。
从 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.
我正在运行 maven 3.0.5(没有—— dry-run or-DpushChanges = false):
[...]
<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>
我做错了什么? 预先感谢您的见解!