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/01/28 18:54:33 UTC

svn commit: r904187 - in /maven/core-integration-testing/trunk: core-it-suite/src/test/java/org/apache/maven/it/ core-it-suite/src/test/resources/mng-4536/ core-it-suite/src/test/resources/mng-4536/mod-a/ core-it-suite/src/test/resources/mng-4536/mod-b...

Author: bentmann
Date: Thu Jan 28 17:54:32 2010
New Revision: 904187

URL: http://svn.apache.org/viewvc?rev=904187&view=rev
Log:
[MNG-4536] Long build time - enforcer running too many times

o Added IT

Added:
    maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4536RequiresNoProjectForkingMojoTest.java   (with props)
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4536/
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4536/mod-a/
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4536/mod-a/pom.xml   (with props)
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4536/mod-b/
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4536/mod-b/pom.xml   (with props)
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4536/pom.xml   (with props)
    maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-fork/src/main/java/org/apache/maven/plugin/coreit/ForkLifecycleNoProjectMojo.java   (with props)
Modified:
    maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
    maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-fork/pom.xml
    maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-fork/src/main/java/org/apache/maven/plugin/coreit/ForkLifecycleMojo.java
    maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-fork/src/main/java/org/apache/maven/plugin/coreit/TouchMojo.java

Modified: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java?rev=904187&r1=904186&r2=904187&view=diff
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java (original)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java Thu Jan 28 17:54:32 2010
@@ -86,6 +86,7 @@
         // suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- MNG-3137
 
         suite.addTestSuite( MavenITmng4544ActiveComponentCollectionThreadSafeTest.class );
+        suite.addTestSuite( MavenITmng4536RequiresNoProjectForkingMojoTest.class );
         suite.addTestSuite( MavenITmng4522FailUponMissingDependencyParentPomTest.class );
         suite.addTestSuite( MavenITmng4500NoUpdateOfTimestampedSnapshotsTest.class );
         suite.addTestSuite( MavenITmng4498IgnoreBrokenMetadataTest.class );

Added: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4536RequiresNoProjectForkingMojoTest.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4536RequiresNoProjectForkingMojoTest.java?rev=904187&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4536RequiresNoProjectForkingMojoTest.java (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4536RequiresNoProjectForkingMojoTest.java Thu Jan 28 17:54:32 2010
@@ -0,0 +1,62 @@
+package org.apache.maven.it;
+
+/*
+ * 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.
+ */
+
+import org.apache.maven.it.Verifier;
+import org.apache.maven.it.util.ResourceExtractor;
+
+import java.io.File;
+
+/**
+ * This is a test set for <a href="http://jira.codehaus.org/browse/MNG-4536">MNG-4536</a>.
+ * 
+ * @author Benjamin Bentmann
+ */
+public class MavenITmng4536RequiresNoProjectForkingMojoTest
+    extends AbstractMavenIntegrationTestCase
+{
+
+    public MavenITmng4536RequiresNoProjectForkingMojoTest()
+    {
+        super( "[2.0.3,3.0-alpha-1),[3.0-alpha-7,)" );
+    }
+
+    /**
+     * Test that forking mojos that require no project only fork the current project and not the entire reactor.
+     */
+    public void testit()
+        throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-4536" );
+
+        Verifier verifier = new Verifier( testDir.getAbsolutePath() );
+        verifier.setAutoclean( false );
+        verifier.deleteDirectory( "target" );
+        verifier.deleteDirectory( "mod-a/target" );
+        verifier.deleteDirectory( "mod-b/target" );
+        verifier.executeGoal( "generate-sources" );
+        verifier.verifyErrorFreeLog();
+        verifier.resetStreams();
+
+        assertEquals( 2, verifier.loadLines( "mod-a/target/touch.log", "UTF-8" ).size() );
+        assertEquals( 2, verifier.loadLines( "mod-b/target/touch.log", "UTF-8" ).size() );
+    }
+
+}

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4536RequiresNoProjectForkingMojoTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4536RequiresNoProjectForkingMojoTest.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4536/mod-a/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4536/mod-a/pom.xml?rev=904187&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4536/mod-a/pom.xml (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4536/mod-a/pom.xml Thu Jan 28 17:54:32 2010
@@ -0,0 +1,36 @@
+<?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>
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.apache.maven.its.mng4536</groupId>
+    <artifactId>test</artifactId>
+    <version>0.1</version>
+  </parent>
+
+  <groupId>org.apache.maven.its.mng4536</groupId>
+  <artifactId>moda</artifactId>
+  <version>0.1</version>
+
+  <name>Maven Integration Test :: MNG-4536 :: Module A</name>
+</project>

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4536/mod-a/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4536/mod-a/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4536/mod-b/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4536/mod-b/pom.xml?rev=904187&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4536/mod-b/pom.xml (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4536/mod-b/pom.xml Thu Jan 28 17:54:32 2010
@@ -0,0 +1,36 @@
+<?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>
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.apache.maven.its.mng4536</groupId>
+    <artifactId>test</artifactId>
+    <version>0.1</version>
+  </parent>
+
+  <groupId>org.apache.maven.its.mng4536</groupId>
+  <artifactId>modb</artifactId>
+  <version>0.1</version>
+
+  <name>Maven Integration Test :: MNG-4536 :: Module B</name>
+</project>

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4536/mod-b/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4536/mod-b/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4536/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4536/pom.xml?rev=904187&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4536/pom.xml (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4536/pom.xml Thu Jan 28 17:54:32 2010
@@ -0,0 +1,58 @@
+<?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>
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>org.apache.maven.its.mng4536</groupId>
+  <artifactId>test</artifactId>
+  <version>0.1</version>
+  <packaging>pom</packaging>
+
+  <name>Maven Integration Test :: MNG-4536</name>
+  <description>
+    Test that forking mojos that require no project only fork the current project and not the entire reactor.
+  </description>
+
+  <modules>
+    <module>mod-a</module>
+    <module>mod-b</module>
+  </modules>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.its.plugins</groupId>
+        <artifactId>maven-it-plugin-fork</artifactId>
+        <version>2.1-SNAPSHOT</version>
+        <executions>
+          <execution>
+            <id>test</id>
+            <phase>generate-sources</phase>
+            <goals>
+              <goal>fork-lifecycle-no-project</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+</project>

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4536/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4536/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-fork/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-fork/pom.xml?rev=904187&r1=904186&r2=904187&view=diff
==============================================================================
--- maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-fork/pom.xml (original)
+++ maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-fork/pom.xml Thu Jan 28 17:54:32 2010
@@ -34,6 +34,10 @@
   <name>Maven Integration Test Plugin :: Fork</name>
   <inceptionYear>2006</inceptionYear>
 
+  <properties>
+    <maven.test.skip>true</maven.test.skip>
+  </properties>
+
   <dependencies>
     <dependency>
       <groupId>org.apache.maven</groupId>
@@ -44,6 +48,16 @@
       <groupId>org.apache.maven</groupId>
       <artifactId>maven-project</artifactId>
       <version>2.0</version>
+      <exclusions>
+        <exclusion>
+          <groupId>org.codehaus.plexus</groupId>
+          <artifactId>plexus-utils</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>org.codehaus.plexus</groupId>
+          <artifactId>plexus-container-default</artifactId>
+        </exclusion>
+      </exclusions>
     </dependency>
   </dependencies>
 </project>

Modified: maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-fork/src/main/java/org/apache/maven/plugin/coreit/ForkLifecycleMojo.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-fork/src/main/java/org/apache/maven/plugin/coreit/ForkLifecycleMojo.java?rev=904187&r1=904186&r2=904187&view=diff
==============================================================================
--- maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-fork/src/main/java/org/apache/maven/plugin/coreit/ForkLifecycleMojo.java (original)
+++ maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-fork/src/main/java/org/apache/maven/plugin/coreit/ForkLifecycleMojo.java Thu Jan 28 17:54:32 2010
@@ -51,7 +51,7 @@
     public void execute()
         throws MojoExecutionException
     {
-        TouchMojo.touch( touchDirectory, "fork-lifecycle.txt", true );
+        TouchMojo.touch( touchDirectory, "fork-lifecycle.txt" );
 
         if ( !executedProject.getBuild().getFinalName().equals( TouchMojo.FINAL_NAME ) )
         {

Added: maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-fork/src/main/java/org/apache/maven/plugin/coreit/ForkLifecycleNoProjectMojo.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-fork/src/main/java/org/apache/maven/plugin/coreit/ForkLifecycleNoProjectMojo.java?rev=904187&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-fork/src/main/java/org/apache/maven/plugin/coreit/ForkLifecycleNoProjectMojo.java (added)
+++ maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-fork/src/main/java/org/apache/maven/plugin/coreit/ForkLifecycleNoProjectMojo.java Thu Jan 28 17:54:32 2010
@@ -0,0 +1,59 @@
+package org.apache.maven.plugin.coreit;
+
+/*
+ * 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.
+ */
+
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+
+import java.io.File;
+
+/**
+ * @goal fork-lifecycle-no-project
+ * @requiresProject false
+ * 
+ * @execute phase="generate-sources" lifecycle="foo"
+ */
+public class ForkLifecycleNoProjectMojo
+    extends AbstractMojo
+{
+
+    /**
+     * @parameter default-value="${project.build.finalName}"
+     */
+    private String finalName;
+
+    /**
+     * @parameter default-value="target"
+     */
+    private File touchDirectory;
+
+    public void execute()
+        throws MojoExecutionException
+    {
+        TouchMojo.touch( touchDirectory, "fork-lifecycle-no-project.txt" );
+
+        if ( TouchMojo.FINAL_NAME.equals( finalName ) )
+        {
+            throw new MojoExecutionException( "forked project was polluted. (should NOT be \'" + TouchMojo.FINAL_NAME
+                + "\')." );
+        }
+    }
+
+}

Propchange: maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-fork/src/main/java/org/apache/maven/plugin/coreit/ForkLifecycleNoProjectMojo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-fork/src/main/java/org/apache/maven/plugin/coreit/ForkLifecycleNoProjectMojo.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-fork/src/main/java/org/apache/maven/plugin/coreit/TouchMojo.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-fork/src/main/java/org/apache/maven/plugin/coreit/TouchMojo.java?rev=904187&r1=904186&r2=904187&view=diff
==============================================================================
--- maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-fork/src/main/java/org/apache/maven/plugin/coreit/TouchMojo.java (original)
+++ maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-fork/src/main/java/org/apache/maven/plugin/coreit/TouchMojo.java Thu Jan 28 17:54:32 2010
@@ -19,7 +19,6 @@
  * under the License.
  */
 
-import org.apache.maven.artifact.Artifact;
 import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.project.MavenProject;
@@ -28,14 +27,11 @@
 import java.io.FileOutputStream;
 import java.io.OutputStreamWriter;
 import java.io.IOException;
-import java.util.Map;
 
 /**
  * @goal touch
  * 
  * @phase process-sources
- *
- * @description Goal which cleans the build
  */
 public class TouchMojo
     extends AbstractMojo
@@ -54,95 +50,23 @@
      */
     private File outputDirectory;
 
-    /** Test setting of plugin-artifacts on the PluginDescriptor instance.
-     * @parameter expression="${plugin.artifactMap}"
-     * @required
-     */
-    private Map pluginArtifacts;
-
-    /**
-     * @parameter expression="target/test-basedir-alignment"
-     */
-    private File basedirAlignmentDirectory;
-
-    /**
-     * @parameter alias="pluginFile"
-     */
-    private String pluginItem = "foo";
-
-    /**
-     * @parameter
-     */
-    private String goalItem = "bar";
-    
-    /**
-     * @parameter expression="${artifactToFile}"
-     */
-    private String artifactToFile;
-    
-    /**
-     * @parameter expression="${fail}"
-     */
-    private boolean fail = false;
-
     public void execute()
         throws MojoExecutionException
     {
-        if ( fail )
-        {
-            throw new MojoExecutionException( "Failing per \'fail\' parameter (specified in pom or system properties)" );
-        }
-
         getLog().info( "[MAVEN-CORE-IT-LOG] Project build directory " + project.getBuild().getDirectory() );
 
+        touch( new File( project.getBuild().getDirectory() ), "touch.log" );
+
         getLog().info( "[MAVEN-CORE-IT-LOG] Using output directory " + outputDirectory );
 
         touch( outputDirectory, "touch.txt" );
 
-        // This parameter should be aligned to the basedir as the parameter type is specified
-        // as java.io.File
-
-        if ( basedirAlignmentDirectory.getPath().equals( "target/test-basedir-alignment" ) )
-        {
-            throw new MojoExecutionException( "basedirAlignmentDirectory not aligned" );
-        }
-        
-        touch( basedirAlignmentDirectory, "touch.txt" );
-
-        // Test parameter setting
-        if ( pluginItem != null )
-        {
-            touch( outputDirectory, pluginItem );
-        }
-
-        if ( goalItem != null )
-        {
-            touch( outputDirectory, goalItem );
-        }
-        
-        if ( artifactToFile != null )
-        {
-            Artifact artifact = (Artifact) pluginArtifacts.get( artifactToFile );
-            
-            File artifactFile = artifact.getFile();
-            
-            String filename = artifactFile.getAbsolutePath().replace('/', '_').replace(':', '_') + ".txt";
-            
-            touch( outputDirectory, filename );
-        }
-
         project.getBuild().setFinalName( FINAL_NAME );
     }
 
     static void touch( File dir, String file )
         throws MojoExecutionException
     {
-        touch( dir, file, false );
-    }
-
-    static void touch( File dir, String file, boolean append )
-        throws MojoExecutionException
-    {
         try
         {
              if ( !dir.exists() )
@@ -151,8 +75,9 @@
              }
              
              File touch = new File( dir, file );
-     
-             OutputStreamWriter w = new OutputStreamWriter( new FileOutputStream( touch, append ), "UTF-8" );
+
+             // NOTE: Using append mode to track execution count
+             OutputStreamWriter w = new OutputStreamWriter( new FileOutputStream( touch, true ), "UTF-8" );
              
              w.write( file );
              w.write( "\n" );
@@ -164,4 +89,5 @@
             throw new MojoExecutionException( "Error touching file", e );
         }
     }
+
 }