You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ol...@apache.org on 2012/05/04 22:55:08 UTC

svn commit: r1334182 - in /maven/plugins/trunk/maven-clean-plugin/src/it/only-test-clean: ./ target/ target/classes/ target/site/ target/test-classes/

Author: olamy
Date: Fri May  4 20:55:07 2012
New Revision: 1334182

URL: http://svn.apache.org/viewvc?rev=1334182&view=rev
Log:
[MCLEAN-50] the ability to clean only test classes: add an it as a sample.

Added:
    maven/plugins/trunk/maven-clean-plugin/src/it/only-test-clean/
    maven/plugins/trunk/maven-clean-plugin/src/it/only-test-clean/invoker.properties   (with props)
    maven/plugins/trunk/maven-clean-plugin/src/it/only-test-clean/pom.xml   (with props)
    maven/plugins/trunk/maven-clean-plugin/src/it/only-test-clean/setup.bsh   (with props)
    maven/plugins/trunk/maven-clean-plugin/src/it/only-test-clean/target/
    maven/plugins/trunk/maven-clean-plugin/src/it/only-test-clean/target/classes/
    maven/plugins/trunk/maven-clean-plugin/src/it/only-test-clean/target/classes/main.properties   (with props)
    maven/plugins/trunk/maven-clean-plugin/src/it/only-test-clean/target/site/
    maven/plugins/trunk/maven-clean-plugin/src/it/only-test-clean/target/site/index.html   (with props)
    maven/plugins/trunk/maven-clean-plugin/src/it/only-test-clean/target/test-1.0-SNAPSHOT.jar
    maven/plugins/trunk/maven-clean-plugin/src/it/only-test-clean/target/test-classes/
    maven/plugins/trunk/maven-clean-plugin/src/it/only-test-clean/target/test-classes/test.properties   (with props)
    maven/plugins/trunk/maven-clean-plugin/src/it/only-test-clean/verify.bsh   (with props)

Added: maven/plugins/trunk/maven-clean-plugin/src/it/only-test-clean/invoker.properties
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-clean-plugin/src/it/only-test-clean/invoker.properties?rev=1334182&view=auto
==============================================================================
--- maven/plugins/trunk/maven-clean-plugin/src/it/only-test-clean/invoker.properties (added)
+++ maven/plugins/trunk/maven-clean-plugin/src/it/only-test-clean/invoker.properties Fri May  4 20:55:07 2012
@@ -0,0 +1 @@
+invoker.goals = clean -Ptest-clean
\ No newline at end of file

Propchange: maven/plugins/trunk/maven-clean-plugin/src/it/only-test-clean/invoker.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-clean-plugin/src/it/only-test-clean/invoker.properties
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/plugins/trunk/maven-clean-plugin/src/it/only-test-clean/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-clean-plugin/src/it/only-test-clean/pom.xml?rev=1334182&view=auto
==============================================================================
--- maven/plugins/trunk/maven-clean-plugin/src/it/only-test-clean/pom.xml (added)
+++ maven/plugins/trunk/maven-clean-plugin/src/it/only-test-clean/pom.xml Fri May  4 20:55:07 2012
@@ -0,0 +1,77 @@
+<?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>default</artifactId>
+  <version>1.0-SNAPSHOT</version>
+
+  <name>Test for clean</name>
+  <description>Check for proper cleaning of default output files.</description>
+
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-clean-plugin</artifactId>
+        <version>@pom.version@</version>
+      </plugin>
+    </plugins>
+  </build>
+
+  <profiles>
+    <profile>
+      <id>test-clean</id>
+      <build>
+        <pluginManagement>
+          <plugins>
+            <plugin>
+              <groupId>org.apache.maven.plugins</groupId>
+              <artifactId>maven-clean-plugin</artifactId>
+              <version>@pom.version@</version>
+              <configuration>
+                <excludeDefaultDirectories>true</excludeDefaultDirectories>
+                <filesets>
+                  <fileset>
+                    <directory>${project.build.testOutputDirectory}</directory>
+                    <!--includes>
+                      <include>test-classe*</include>
+                    </includes-->
+                  </fileset>
+                </filesets>
+              </configuration>
+            </plugin>
+          </plugins>
+        </pluginManagement>
+      </build>
+    </profile>
+  </profiles>
+
+
+</project>

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

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

Added: maven/plugins/trunk/maven-clean-plugin/src/it/only-test-clean/setup.bsh
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-clean-plugin/src/it/only-test-clean/setup.bsh?rev=1334182&view=auto
==============================================================================
--- maven/plugins/trunk/maven-clean-plugin/src/it/only-test-clean/setup.bsh (added)
+++ maven/plugins/trunk/maven-clean-plugin/src/it/only-test-clean/setup.bsh Fri May  4 20:55:07 2012
@@ -0,0 +1,22 @@
+import java.io.*;
+import java.util.*;
+import java.util.jar.*;
+import java.util.regex.*;
+
+try
+{
+    File targetDir = new File( basedir, "target" );
+    System.out.println( "Checking for existence of " + targetDir );
+    if ( !targetDir.isDirectory() )
+    {
+        System.out.println( "FAILURE!" );
+        return false;
+    }
+}
+catch( Throwable t )
+{
+    t.printStackTrace();
+    return false;
+}
+
+return true;

Propchange: maven/plugins/trunk/maven-clean-plugin/src/it/only-test-clean/setup.bsh
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-clean-plugin/src/it/only-test-clean/setup.bsh
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/plugins/trunk/maven-clean-plugin/src/it/only-test-clean/target/classes/main.properties
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-clean-plugin/src/it/only-test-clean/target/classes/main.properties?rev=1334182&view=auto
==============================================================================
    (empty)

Propchange: maven/plugins/trunk/maven-clean-plugin/src/it/only-test-clean/target/classes/main.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-clean-plugin/src/it/only-test-clean/target/classes/main.properties
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/plugins/trunk/maven-clean-plugin/src/it/only-test-clean/target/site/index.html
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-clean-plugin/src/it/only-test-clean/target/site/index.html?rev=1334182&view=auto
==============================================================================
    (empty)

Propchange: maven/plugins/trunk/maven-clean-plugin/src/it/only-test-clean/target/site/index.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-clean-plugin/src/it/only-test-clean/target/site/index.html
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/plugins/trunk/maven-clean-plugin/src/it/only-test-clean/target/test-1.0-SNAPSHOT.jar
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-clean-plugin/src/it/only-test-clean/target/test-1.0-SNAPSHOT.jar?rev=1334182&view=auto
==============================================================================
Files maven/plugins/trunk/maven-clean-plugin/src/it/only-test-clean/target/test-1.0-SNAPSHOT.jar (added) and maven/plugins/trunk/maven-clean-plugin/src/it/only-test-clean/target/test-1.0-SNAPSHOT.jar Fri May  4 20:55:07 2012 differ

Added: maven/plugins/trunk/maven-clean-plugin/src/it/only-test-clean/target/test-classes/test.properties
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-clean-plugin/src/it/only-test-clean/target/test-classes/test.properties?rev=1334182&view=auto
==============================================================================
    (empty)

Propchange: maven/plugins/trunk/maven-clean-plugin/src/it/only-test-clean/target/test-classes/test.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-clean-plugin/src/it/only-test-clean/target/test-classes/test.properties
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/plugins/trunk/maven-clean-plugin/src/it/only-test-clean/verify.bsh
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-clean-plugin/src/it/only-test-clean/verify.bsh?rev=1334182&view=auto
==============================================================================
--- maven/plugins/trunk/maven-clean-plugin/src/it/only-test-clean/verify.bsh (added)
+++ maven/plugins/trunk/maven-clean-plugin/src/it/only-test-clean/verify.bsh Fri May  4 20:55:07 2012
@@ -0,0 +1,37 @@
+import java.io.*;
+import java.util.*;
+import java.util.jar.*;
+import java.util.regex.*;
+
+try
+{
+    File targetDir = new File( basedir, "target" );
+    System.out.println( "Checking for absence of " + targetDir );
+    if ( !targetDir.exists() )
+    {
+        System.out.println( "FAILURE!  target must exists" );
+        return false;
+    }
+
+    File targetClasses = new File( targetDir, "classes" );
+    if ( !targetClasses.exists() )
+    {
+        System.out.println( "FAILURE!  target/classes must exists" );
+        return false;
+    }
+
+    File targetTestsClasses = new File( targetDir, "test-classes" );
+    if ( targetTestsClasses.exists() )
+    {
+        System.out.println( "FAILURE!  target/test-classes must not exists" );
+        return false;
+    }
+
+}
+catch( Throwable t )
+{
+    t.printStackTrace();
+    return false;
+}
+
+return true;

Propchange: maven/plugins/trunk/maven-clean-plugin/src/it/only-test-clean/verify.bsh
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-clean-plugin/src/it/only-test-clean/verify.bsh
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision