Maven release plugin and local changes

It may happen that you’re trying to fix some issues that affects the release of a maven project and therefore you apply some changes locally and then run

mvn release:prepare -DdryRun=true -Darguments=-DskipTests

Then you get an error message like

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.5.3:prepare (default-cli) on project jackrabbit-oak: Cannot prepare the release because you have local modifications :
[ERROR] [oak-api/src/main/java/org/apache/jackrabbit/oak/api/PropertyState.java:modified]
[ERROR] [oak-api/src/main/java/org/apache/jackrabbit/oak/api/jmx/CacheStatsMBean.java:modified]
[ERROR] [oak-api/src/main/java/org/apache/jackrabbit/oak/api/jmx/CheckpointMBean.java:modified]
[ERROR] [oak-api/src/main/java/org/apache/jackrabbit/oak/api/jmx/IndexStatsMBean.java:modified]
[ERROR] [oak-api/src/main/java/org/apache/jackrabbit/oak/api/jmx/RepositoryStatsMBean.java:modified]

Sure. release-plugin is giving you an extra check about any local changes that may not end in the release. However you don’t want to commit those changes to the SCM just yet; you want first to see if they works.

A “quick” workaround is on the command line in the (verbose) form of

mvn release:prepare -DdryRun=true -Darguments=-DskipTests -DcheckModificationExcludeList=oak-api/src/main/java/org/apache/jackrabbit/oak/api/*,oak-api/src/main/java/org/apache/jackrabbit/oak/api/jmx/*

You can as well specify something in the poms directly however I never had the need.

References:

 

weekly links 2010-42 & 43

Adding Google Maps to your Java Application

RE: Moving from Spring to Java EE 6: The Age of Frameworks is Over

Java deprecation on MacOSX

How To Choose A Java EE Application Server? (Mail Of The Week)

Steve Jobs Comments on Apple’s Java Discontinuation

JDK / Java 7 on Mac OS X Lion – An Interesting Business Opportunity

Generate, rename and delete getters/setters instantly in Eclipse

Already known but nice to have it detailed 🙂

What Ubuntu should mainly do for 11.04

Mozilla Confirms Firefox Zero-Day and Recommends NoScript

Ubuntu changes its desktop from GNOME to Unity

Java Mac Trojan

the interest of crackers in Apple products is raising.

Mozilla patches Firefox zero-day bug in 48 hours

Introducing JSOP

Yes, a bit old post (Aug 2010) but still interesting

Ajax user authentication and registration techniques with jQuery

Learn how to use Asynchronous JavaScript + XML (Ajax) with jQuery to authenticate and sign-in a user without refreshing the browser. Then, take it a step farther by suggesting user names to a new user who’s attempting to register with an existing user name.