How to disable maven release plugin check local modifications?

I'm not very familiar with maven-release-plugin, but I can see that there is a checkModificationExcludes property that you can use for your purpose. The config should be somewhat like this:

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-release-plugin</artifactId>
  <version>2.2.2</version>
  <configuration>
    ...
    <checkModificationExcludes>
      <checkModificationExclude>file_1</checkModificationExclude>
      <checkModificationExclude>dir_1/file_2</checkModificationExclude>
    </checkModificationExcludes>
  </configuration>
</plugin>

We were trying to run the release from jenkins but it always failed with the same message...

Cannot prepare the release because you have local modifications 

... which was weird, because we use jenkins to check out and build the latest sources before releasing.

We finally figured out that the problem was that we were building on a Windows node and some file paths were too long which caused the maven-release-plugin to complain about local modifications. Switching to a linux node solved this problem.


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