我正在尝试使用 Maven 发布 Jenkins 插件 ( stashNotifier ) 并面临发布插件的问题。
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 已经包含下一个开发版本,这反过来又会导致后续 release:perform 发布该快照版本。
从 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 或 -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>
我究竟做错了什么?提前感谢您的见解!