You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by vs...@apache.org on 2007/11/13 23:33:44 UTC
svn commit: r594679 - in /maven/plugins/trunk/maven-clean-plugin/src:
main/java/org/apache/maven/plugin/clean/CleanMojo.java
site/apt/examples/skipping-test.apt site/site.xml
Author: vsiveton
Date: Tue Nov 13 14:33:43 2007
New Revision: 594679
URL: http://svn.apache.org/viewvc?rev=594679&view=rev
Log:
MCLEAN-24: Disable plugin execution
o adding a skip parameter
o updated documentation
Added:
maven/plugins/trunk/maven-clean-plugin/src/site/apt/examples/skipping-test.apt (with props)
Modified:
maven/plugins/trunk/maven-clean-plugin/src/main/java/org/apache/maven/plugin/clean/CleanMojo.java
maven/plugins/trunk/maven-clean-plugin/src/site/site.xml
Modified: maven/plugins/trunk/maven-clean-plugin/src/main/java/org/apache/maven/plugin/clean/CleanMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-clean-plugin/src/main/java/org/apache/maven/plugin/clean/CleanMojo.java?rev=594679&r1=594678&r2=594679&view=diff
==============================================================================
--- maven/plugins/trunk/maven-clean-plugin/src/main/java/org/apache/maven/plugin/clean/CleanMojo.java (original)
+++ maven/plugins/trunk/maven-clean-plugin/src/main/java/org/apache/maven/plugin/clean/CleanMojo.java Tue Nov 13 14:33:43 2007
@@ -122,6 +122,14 @@
private FileSetManager fileSetManager;
/**
+ * Disable the plugin execution.
+ *
+ * @parameter expression="${clean.skip}" default-value="false"
+ * @since 2.2
+ */
+ private boolean skip;
+
+ /**
* Deletes file-sets in the following project build directory order:
* (source) directory, output directory, test directory, report directory,
* and then the additional file-sets.
@@ -132,6 +140,12 @@
public void execute()
throws MojoExecutionException
{
+ if ( skip )
+ {
+ getLog().info( "Clean is skipped." );
+ return;
+ }
+
fileSetManager = new FileSetManager( getLog(), verbose );
removeDirectory( directory );
Added: maven/plugins/trunk/maven-clean-plugin/src/site/apt/examples/skipping-test.apt
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-clean-plugin/src/site/apt/examples/skipping-test.apt?rev=594679&view=auto
==============================================================================
--- maven/plugins/trunk/maven-clean-plugin/src/site/apt/examples/skipping-test.apt (added)
+++ maven/plugins/trunk/maven-clean-plugin/src/site/apt/examples/skipping-test.apt Tue Nov 13 14:33:43 2007
@@ -0,0 +1,50 @@
+ ------
+ Skipping Clean
+ ------
+ Vincent Siveton
+ ------
+ 13 November 2007
+ ------
+
+~~ Licensed to the Apache Software Foundation (ASF) under one
+~~ or more contributor license agreements. See the NOTICE file
+~~ distributed with this work for additional information
+~~ regarding copyright ownership. The ASF licenses this file
+~~ to you under the Apache License, Version 2.0 (the
+~~ "License"); you may not use this file except in compliance
+~~ with the License. You may obtain a copy of the License at
+~~
+~~ http://www.apache.org/licenses/LICENSE-2.0
+~~
+~~ Unless required by applicable law or agreed to in writing,
+~~ software distributed under the License is distributed on an
+~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+~~ KIND, either express or implied. See the License for the
+~~ specific language governing permissions and limitations
+~~ under the License.
+
+~~ NOTE: For help with the syntax of this file, see:
+~~ http://maven.apache.org/guides/mini/guide-apt-format.html
+
+Skipping Clean
+
+ To skip running the cleanup for a particular project, set the skip property to true.
+
++--------
+<build>
+ [...]
+ <plugin>
+ <artifactId>maven-clean-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ [...]
+</build>
++---------
+
+ You can also skip the cleaning via command line by executing the following command:
+
++--------
+mvn clean -Dclean.skip=true
++---------
Propchange: maven/plugins/trunk/maven-clean-plugin/src/site/apt/examples/skipping-test.apt
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-clean-plugin/src/site/apt/examples/skipping-test.apt
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Modified: maven/plugins/trunk/maven-clean-plugin/src/site/site.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-clean-plugin/src/site/site.xml?rev=594679&r1=594678&r2=594679&view=diff
==============================================================================
--- maven/plugins/trunk/maven-clean-plugin/src/site/site.xml (original)
+++ maven/plugins/trunk/maven-clean-plugin/src/site/site.xml Tue Nov 13 14:33:43 2007
@@ -28,6 +28,7 @@
<item name="FAQ" href="faq.html"/>
</menu>
<menu name="Examples">
+ <item name="Skipping Clean" href="examples/skipping-clean.html"/>
<item name="Delete Additional Files" href="examples/delete_additional_files.html"/>
</menu>
</body>