Maven release:prepare : Cannot prepare the release because you have local modifications

大城市里の小女人 提交于 2019-12-05 03:41:59
4F2E4A2E

I can confirm, that adding the plugin or configuring it to exclude the pom.xml check did work:

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-release-plugin</artifactId>
  <configuration>
    <checkModificationExcludes>
        <checkModificationExclude>pom.xml</checkModificationExclude>
    </checkModificationExcludes>
  </configuration>
</plugin>

Removing my project's target folder from source control fixed this issue for me.

For everybody who don't want to change the pom.xml a commandline option does the trick:

mvn [...] -DcheckModificationExcludeList=pom.xml,.maven/spy.log

I had the problem on our hudson / jenkins CI environment which complained about changes in the .maven/spy.log

For me solution is staging and commiting pom.xml or any other changed file to push git

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<configuration>
    <checkModificationExcludes>
        <checkModificationExclude>pom.xml</checkModificationExclude>
        <checkModificationExclude>**</checkModificationExclude>
    </checkModificationExcludes>
</configuration>

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!