mvn release:准备不提交并检测本地更改

时间:2018-04-04 10:15:22

标签: java git maven maven-release-plugin

我的mvn版本有两个奇怪的行为:准备

1 /即使检测到本地更改未提交,也不会停止!

[DEBUG] release.properties not found - using empty properties
[INFO] Verifying that there are no local modifications...
[INFO]   ignoring changes on: **\pom.xml.next, **\release.properties, **\pom.xml.branch, **\pom.xml.tag, **\pom.xml.backup, **\pom.xml.releaseBackup
[INFO] Executing: cmd.exe /X /C "git rev-parse --show-toplevel"
[INFO] Working directory: D:\XX
[INFO] Executing: cmd.exe /X /C "git status --porcelain ."
[INFO] Working directory: D:\XX
[DEBUG] A  testFab2
[DEBUG] ?? release.properties
[WARNING] Ignoring unrecognized line: ?? release.properties
[INFO] Checking dependencies and plugins for snapshots ...
What is the release version for "XX-parent"? (YY:XX-parent) 1.3.2: :

2 /它没有提交并推送修改后的pom.xml ...

更令人困惑的是,我的同事计算机上的正常行为很好。我们有相同的配置。这里有一些技术信息:

GIT中

git version 2.16.2

mvn --version

 Apache Maven 3.5.3 (3383c37e1f9e9b3bc3df5050c29c8aff9f295297; 2018-02-24T20:49:05+01:00)
 Maven home: D:\tools\apache-maven-3.5.3
 Java version: 1.8.0_162, vendor: Oracle Corporation
 Java home: C:\Program Files\Java\jdk1.8.0_162\jre
 Default locale: fr_FR, platform encoding: Cp1252
 OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"

插件maven-release

<plugin>
   <groupId>org.apache.maven.plugins</groupId>
   <artifactId>maven-release-plugin</artifactId>
   <version>2.5.3</version>
   <configuration>
       <goals>install</goals>
       <tagNameFormat>@{project.version}</tagNameFormat>
       <autoVersionSubmodules>true</autoVersionSubmodules>
       <preparationGoals>verify</preparationGoals>
       <arguments>-Dmaven.javadoc.skip=true -Dmaven.site.skip=true</arguments>
   </configuration>
</plugin>

我曾尝试在这篇帖子中降级插件:mvn release:prepare not committing changes to pom.xml,但没有成功

如果你有一些想法...... 谢谢

1 个答案:

答案 0 :(得分:0)

使用带有PushChanges = false的maven命令。