Author: dennisl
Date: Thu Feb 23 22:21:44 2012
New Revision: 1292992
URL: http://svn.apache.org/viewvc?rev=1292992&view=rev
Log:
[MRESOURCES-131] Maven resources plugin does not honour maven.test.skip flag
Added:
maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-131/
maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-131/pom.xml
(with props)
maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-131/src/
maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-131/src/main/
maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-131/src/main/java/
maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-131/src/main/java/org/
maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-131/src/main/java/org/apache/
maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-131/src/main/java/org/apache/maven/
maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-131/src/main/java/org/apache/maven/plugins/
maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-131/src/main/java/org/apache/maven/plugins/resources/
maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-131/src/main/java/org/apache/maven/plugins/resources/it/
maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-131/src/main/java/org/apache/maven/plugins/resources/it/App.java
(with props)
maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-131/src/test/
maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-131/src/test/java/
maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-131/src/test/java/org/
maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-131/src/test/java/org/apache/
maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-131/src/test/java/org/apache/maven/
maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-131/src/test/java/org/apache/maven/plugins/
maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-131/src/test/java/org/apache/maven/plugins/resources/
maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-131/src/test/java/org/apache/maven/plugins/resources/it/
maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-131/src/test/java/org/apache/maven/plugins/resources/it/AppTest.java
(with props)
maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-131/src/test/resources/
maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-131/src/test/resources/skipped.txt
(with props)
maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-131/verify.groovy
(with props)
Modified:
maven/plugins/trunk/maven-resources-plugin/src/main/java/org/apache/maven/plugin/resources/TestResourcesMojo.java
Added: maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-131/pom.xml
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-131/pom.xml?rev=1292992&view=auto
==============================================================================
--- maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-131/pom.xml
(added)
+++ maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-131/pom.xml
Thu Feb 23 22:21:44 2012
@@ -0,0 +1,51 @@
+<?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/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.apache.maven.plugins.resources.it</groupId>
+ <artifactId>MRESOURCES-131</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <packaging>jar</packaging>
+
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <artifactId>maven-resources-plugin</artifactId>
+ <version>@pom.version@</version>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+</project>
Propchange:
maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-131/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-131/pom.xml
------------------------------------------------------------------------------
svn:keywords = Date Revision Author Id
Added:
maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-131/src/main/java/org/apache/maven/plugins/resources/it/App.java
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-131/src/main/java/org/apache/maven/plugins/resources/it/App.java?rev=1292992&view=auto
==============================================================================
---
maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-131/src/main/java/org/apache/maven/plugins/resources/it/App.java
(added)
+++
maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-131/src/main/java/org/apache/maven/plugins/resources/it/App.java
Thu Feb 23 22:21:44 2012
@@ -0,0 +1,32 @@
+package org.apache.maven.plugins.resources.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.
+ */
+
+/**
+ * Hello world!
+ *
+ */
+public class App
+{
+ public static void main( String[] args )
+ {
+ System.out.println( "Hello World!" );
+ }
+}
Propchange:
maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-131/src/main/java/org/apache/maven/plugins/resources/it/App.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-131/src/main/java/org/apache/maven/plugins/resources/it/App.java
------------------------------------------------------------------------------
svn:keywords = Date Revision Author Id
Added:
maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-131/src/test/java/org/apache/maven/plugins/resources/it/AppTest.java
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-131/src/test/java/org/apache/maven/plugins/resources/it/AppTest.java?rev=1292992&view=auto
==============================================================================
---
maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-131/src/test/java/org/apache/maven/plugins/resources/it/AppTest.java
(added)
+++
maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-131/src/test/java/org/apache/maven/plugins/resources/it/AppTest.java
Thu Feb 23 22:21:44 2012
@@ -0,0 +1,57 @@
+package org.apache.maven.plugins.resources.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 junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+/**
+ * Unit test for simple App.
+ */
+public class AppTest
+ extends TestCase
+{
+ /**
+ * Create the test case
+ *
+ * @param testName name of the test case
+ */
+ public AppTest( String testName )
+ {
+ super( testName );
+ }
+
+ /**
+ * @return the suite of tests being tested
+ */
+ public static Test suite()
+ {
+ return new TestSuite( AppTest.class );
+ }
+
+ /**
+ * Rigourous Test :-)
+ */
+ public void testApp()
+ {
+ assertTrue( true );
+ }
+}
Propchange:
maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-131/src/test/java/org/apache/maven/plugins/resources/it/AppTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-131/src/test/java/org/apache/maven/plugins/resources/it/AppTest.java
------------------------------------------------------------------------------
svn:keywords = Date Revision Author Id
Added:
maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-131/src/test/resources/skipped.txt
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-131/src/test/resources/skipped.txt?rev=1292992&view=auto
==============================================================================
---
maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-131/src/test/resources/skipped.txt
(added)
+++
maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-131/src/test/resources/skipped.txt
Thu Feb 23 22:21:44 2012
@@ -0,0 +1 @@
+This file should be skipped.
\ No newline at end of file
Propchange:
maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-131/src/test/resources/skipped.txt
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-131/src/test/resources/skipped.txt
------------------------------------------------------------------------------
svn:keywords = Date Revision Author Id
Added:
maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-131/verify.groovy
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-131/verify.groovy?rev=1292992&view=auto
==============================================================================
---
maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-131/verify.groovy
(added)
+++
maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-131/verify.groovy
Thu Feb 23 22:21:44 2012
@@ -0,0 +1,22 @@
+/*
+ * 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.
+ */
+skippedFile = new File(basedir, 'target/test-classes/skipped.txt');
+assert !skippedFile.exists();
+
+return true;
\ No newline at end of file
Propchange:
maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-131/verify.groovy
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-131/verify.groovy
------------------------------------------------------------------------------
svn:keywords = Date Revision Author Id
Modified:
maven/plugins/trunk/maven-resources-plugin/src/main/java/org/apache/maven/plugin/resources/TestResourcesMojo.java
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-resources-plugin/src/main/java/org/apache/maven/plugin/resources/TestResourcesMojo.java?rev=1292992&r1=1292991&r2=1292992&view=diff
==============================================================================
---
maven/plugins/trunk/maven-resources-plugin/src/main/java/org/apache/maven/plugin/resources/TestResourcesMojo.java
(original)
+++
maven/plugins/trunk/maven-resources-plugin/src/main/java/org/apache/maven/plugin/resources/TestResourcesMojo.java
Thu Feb 23 22:21:44 2012
@@ -19,6 +19,8 @@ package org.apache.maven.plugin.resource
* under the License.
*/
+import org.apache.maven.plugin.MojoExecutionException;
+
import java.io.File;
import java.util.List;
@@ -54,6 +56,30 @@ public class TestResourcesMojo
*/
private List resources;
+ /**
+ * Set this to 'true' to bypass copying of test resources.
+ * Its use is NOT RECOMMENDED, but quite convenient on occasion.
+ *
+ * @parameter expression="${maven.test.skip}"
+ */
+ private boolean skip;
+
+ /**
+ * {@inheritDoc}
+ */
+ public void execute()
+ throws MojoExecutionException
+ {
+ if ( skip )
+ {
+ getLog().info( "Not copying test resources" );
+ }
+ else
+ {
+ super.execute();
+ }
+ }
+
public File getOutputDirectory()
{
return outputDirectory;