You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by be...@apache.org on 2010/03/21 14:37:23 UTC

svn commit: r925766 - in /maven/plugins/trunk/maven-invoker-plugin/src: it/clone-clean/ it/clone-clean/src/ it/clone-clean/src/it/ it/clone-clean/src/it/clone-clean/ main/java/org/apache/maven/plugin/invoker/

Author: bentmann
Date: Sun Mar 21 13:37:22 2010
New Revision: 925766

URL: http://svn.apache.org/viewvc?rev=925766&view=rev
Log:
[MINVOKER-101] provide property to make a clean clone

o Polished code

Added:
    maven/plugins/trunk/maven-invoker-plugin/src/it/clone-clean/src/
    maven/plugins/trunk/maven-invoker-plugin/src/it/clone-clean/src/it/
    maven/plugins/trunk/maven-invoker-plugin/src/it/clone-clean/src/it/clone-clean/
    maven/plugins/trunk/maven-invoker-plugin/src/it/clone-clean/src/it/clone-clean/pom.xml   (with props)
Modified:
    maven/plugins/trunk/maven-invoker-plugin/src/it/clone-clean/pom.xml
    maven/plugins/trunk/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/AbstractInvokerMojo.java

Modified: maven/plugins/trunk/maven-invoker-plugin/src/it/clone-clean/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-invoker-plugin/src/it/clone-clean/pom.xml?rev=925766&r1=925765&r2=925766&view=diff
==============================================================================
--- maven/plugins/trunk/maven-invoker-plugin/src/it/clone-clean/pom.xml (original)
+++ maven/plugins/trunk/maven-invoker-plugin/src/it/clone-clean/pom.xml Sun Mar 21 13:37:22 2010
@@ -27,7 +27,7 @@ under the License.
   <version>1.0-SNAPSHOT</version>
   <packaging>pom</packaging>
 
-  <description>Test to check for support to launch Maven on a mere directory, i.e. without a POM</description>
+  <description>Test to check for cleaning of cloned project directories before execution.</description>
 
   <properties>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -43,10 +43,10 @@ under the License.
           <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
           <cloneClean>true</cloneClean>
           <pomIncludes>
-            <pomInclude>clone-clean</pomInclude>
+            <pomInclude>*/pom.xml</pomInclude>
           </pomIncludes>
           <goals>
-            <goal>--version</goal>
+            <goal>validate</goal>
           </goals>
         </configuration>
         <executions>

Added: maven/plugins/trunk/maven-invoker-plugin/src/it/clone-clean/src/it/clone-clean/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-invoker-plugin/src/it/clone-clean/src/it/clone-clean/pom.xml?rev=925766&view=auto
==============================================================================
--- maven/plugins/trunk/maven-invoker-plugin/src/it/clone-clean/src/it/clone-clean/pom.xml (added)
+++ maven/plugins/trunk/maven-invoker-plugin/src/it/clone-clean/src/it/clone-clean/pom.xml Sun Mar 21 13:37:22 2010
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+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.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>test</groupId>
+  <artifactId>clone-clean</artifactId>
+  <version>0.1-SNAPSHOT</version>
+  <packaging>jar</packaging>
+
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+</project>

Propchange: maven/plugins/trunk/maven-invoker-plugin/src/it/clone-clean/src/it/clone-clean/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-invoker-plugin/src/it/clone-clean/src/it/clone-clean/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: maven/plugins/trunk/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/AbstractInvokerMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/AbstractInvokerMojo.java?rev=925766&r1=925765&r2=925766&view=diff
==============================================================================
--- maven/plugins/trunk/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/AbstractInvokerMojo.java (original)
+++ maven/plugins/trunk/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/AbstractInvokerMojo.java Sun Mar 21 13:37:22 2010
@@ -162,9 +162,10 @@ public abstract class AbstractInvokerMoj
     private boolean cloneAllFiles;
     
     /**
-     * Ensure the cloneProjectsTo directory is not polluted with files from earlier invoker runs.  
+     * Ensure the {@link #cloneProjectsTo} directory is not polluted with files from earlier invoker runs.
      * 
      * @parameter default-value="false"
+     * @since 1.6
      */
     private boolean cloneClean;
 
@@ -758,7 +759,7 @@ public abstract class AbstractInvokerMoj
     private void cloneProjects( Collection projectPaths )
         throws MojoExecutionException
     {
-        if ( !cloneProjectsTo.mkdirs() && cloneClean ) 
+        if ( !cloneProjectsTo.mkdirs() && cloneClean )
         {
             try
             {
@@ -766,7 +767,8 @@ public abstract class AbstractInvokerMoj
             }
             catch ( IOException e )
             {
-                throw new MojoExecutionException( "Could not clean the cloneProjectsTo directory. Reason: " + e.getMessage(), e );
+                throw new MojoExecutionException( "Could not clean the cloneProjectsTo directory. Reason: "
+                    + e.getMessage(), e );
             }
         }