Author: jvanzyl
Date: Mon Aug 21 16:31:30 2006
New Revision: 433426

URL: http://svn.apache.org/viewvc?rev=433426&view=rev
Log:
[MJAR-7] Adding parameter to control the creation of JAR files
Submitted by: Jochen Wiedmann

o adding the forceCreation parameter to the mojo

  - before this goes to vote john and i were discussing a standard for naming 
parameters where
    the element in the plugin configuration would be of the form

    verb or verbNoun i.e. forceCreation

    and the expression would be 

    ${prefix.verbNoun} i.e. ${jar.forceCreation}

    So that the use of -Djar.forceCreation couldn't clash with any other 
expression for cli use.

    Will post to the list but I changed the parameter to conform.
 

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=433426&r1=433425&r2=433426&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
 Mon Aug 21 16:31:30 2006
@@ -88,6 +88,12 @@
     private MavenProjectHelper projectHelper;
 
     /**
+     * Whether creating the archive should be forced.
+     * @parameter expression="${jar.forceCreation}" default-value="false"
+     */
+    private boolean forceCreation;
+
+    /**
      * Return the specific output directory to serve as the root for the 
archive.
      */
     protected abstract File getClassesDirectory();
@@ -131,6 +137,8 @@
         archiver.setArchiver( jarArchiver );
 
         archiver.setOutputFile( jarFile );
+
+        archive.setForced( forceCreation );
 
         try
         {


Reply via email to