You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by bi...@apache.org on 2012/06/29 15:35:04 UTC

svn commit: r1355379 - /maven/plugins/trunk/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/AbstractJarMojo.java

Author: bimargulies
Date: Fri Jun 29 13:35:03 2012
New Revision: 1355379

URL: http://svn.apache.org/viewvc?rev=1355379&view=rev
Log:
MJAR-157: forceUpdate documentation is insufficient
o add documentation.

Modified:
    maven/plugins/trunk/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/AbstractJarMojo.java

Modified: maven/plugins/trunk/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/AbstractJarMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/AbstractJarMojo.java?rev=1355379&r1=1355378&r2=1355379&view=diff
==============================================================================
--- maven/plugins/trunk/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/AbstractJarMojo.java (original)
+++ maven/plugins/trunk/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/AbstractJarMojo.java Fri Jun 29 13:35:03 2012
@@ -19,7 +19,6 @@ package org.apache.maven.plugin.jar;
  * under the License.
  */
 
-import java.io.File;
 import org.apache.maven.archiver.MavenArchiveConfiguration;
 import org.apache.maven.archiver.MavenArchiver;
 import org.apache.maven.execution.MavenSession;
@@ -29,6 +28,8 @@ import org.apache.maven.project.MavenPro
 import org.apache.maven.project.MavenProjectHelper;
 import org.codehaus.plexus.archiver.jar.JarArchiver;
 
+import java.io.File;
+
 /**
  * Base class for creating a jar from project classes.
  *
@@ -132,7 +133,14 @@ public abstract class AbstractJarMojo
     private MavenProjectHelper projectHelper;
 
     /**
-     * Whether creating the archive should be forced.
+     * Require the jar plugin to build a new JAR even if none of the contents appear to have changed.
+     * By default, this plugin looks to see if the output jar exists and inputs have not changed.
+     * If these conditions are true, the plugin skips creation of the jar. This does not work when
+     * other plugins, like the maven-shade-plugin, are configured to post-process the jar.
+     * This plugin can not detect the post-processing, and so leaves the post-processed jar in place.
+     * This can lead to failures when those plugins do not expect to find their own output
+     * as an input. Set this parameter to <tt>true</tt> to avoid these problems by forcing
+     * this plugin to recreate the jar every time.
      *
      * @parameter expression="${jar.forceCreation}" default-value="false"
      */