Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable maven release plugin check local modifications?

I use maven release plugin. In my pom exists and Ant task that automatically fix some properties files with additional information. This fixes should not be in SCM. But maven don't finish with success for error:

Cannot prepare the release because you have local modifications 

Does it possible to set some parameters to don't check local modifications?

Thanks.

like image 641
user710818 Avatar asked Feb 04 '12 10:02

user710818


People also ask

What is Maven release plugin?

This plugin is used to release a project with Maven, saving a lot of repetitive, manual work. Releasing a project is made in two steps: prepare and perform. Note: Maven 3 users are encouraged to use at least Maven-3.0. 4 due to some settings related issues.

What is mvn release prepare?

mvn release:perform This is the command which actually does the release by downloading the tagged version from SCM e.g. SVN or CVS or Git. We usually call this command after release:prepare, which creates the tag in SCM but you can also release any specified tag created previously.

What does mvn release do?

mvn release will basically put your current code in a tag on your SCM, change your version in your projects. mvn deploy will put your packaged maven project into a remote repository for sharing with other developers.

What is release prepare?

Description: Prepare for a release in SCM. Steps through several phases to ensure the POM is ready to be released and then prepares SCM to eventually contain a tagged version of the release and a record in the local copy of the parameters used. This can be followed by a call to release:perform .


1 Answers

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>
like image 63
Andrew Logvinov Avatar answered Oct 05 '22 11:10

Andrew Logvinov