【问题标题】:mvn release:prepare do not commit and do detect local changesmvn release:prepare 不提交并检测本地更改
【发布时间】:2018-09-13 20:47:56
【问题描述】:

我的 mvn release:prepare 有两个奇怪的行为

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,但没有成功

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

【问题讨论】:

    标签: java git maven maven-release-plugin


    【解决方案1】:

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

    【讨论】:

    • 能否解释一下效果,写一个示例和/或添加对文档的引用?
    猜你喜欢
    • 2013-02-16
    • 2015-11-12
    • 2020-05-15
    • 2013-02-18
    • 1970-01-01
    • 2010-11-11
    • 1970-01-01
    • 2013-10-21
    • 1970-01-01
    相关资源
    最近更新 更多