You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by kh...@apache.org on 2015/12/05 15:20:44 UTC
svn commit: r1718087 - in /maven/plugins/trunk/maven-resources-plugin/src:
it/filter-filenames/ it/filter-filenames/src/ it/filter-filenames/src/main/
it/filter-filenames/src/main/resources/
main/java/org/apache/maven/plugin/resources/
Author: khmarbaise
Date: Sat Dec 5 14:20:44 2015
New Revision: 1718087
URL: http://svn.apache.org/viewvc?rev=1718087&view=rev
Log:
[MRESOURCES-187] New parameter in the plugin to be able to use filename filtering.
Added integration test.
Added:
maven/plugins/trunk/maven-resources-plugin/src/it/filter-filenames/
maven/plugins/trunk/maven-resources-plugin/src/it/filter-filenames/pom.xml
maven/plugins/trunk/maven-resources-plugin/src/it/filter-filenames/src/
maven/plugins/trunk/maven-resources-plugin/src/it/filter-filenames/src/main/
maven/plugins/trunk/maven-resources-plugin/src/it/filter-filenames/src/main/resources/
maven/plugins/trunk/maven-resources-plugin/src/it/filter-filenames/src/main/resources/${project.artifactId}.txt
maven/plugins/trunk/maven-resources-plugin/src/it/filter-filenames/src/main/resources/${project.version}.txt
maven/plugins/trunk/maven-resources-plugin/src/it/filter-filenames/verify.groovy
Modified:
maven/plugins/trunk/maven-resources-plugin/src/main/java/org/apache/maven/plugin/resources/ResourcesMojo.java
Added: maven/plugins/trunk/maven-resources-plugin/src/it/filter-filenames/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-resources-plugin/src/it/filter-filenames/pom.xml?rev=1718087&view=auto
==============================================================================
--- maven/plugins/trunk/maven-resources-plugin/src/it/filter-filenames/pom.xml (added)
+++ maven/plugins/trunk/maven-resources-plugin/src/it/filter-filenames/pom.xml Sat Dec 5 14:20:44 2015
@@ -0,0 +1,48 @@
+<?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>org.apache.maven.plugins</groupId>
+ <artifactId>maven-resources-plugin-it-filter-filenames</artifactId>
+ <packaging>jar</packaging>
+ <version>1.0-SNAPSHOT</version>
+
+ <build>
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ <filtering>true</filtering>
+ </resource>
+ </resources>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <artifactId>maven-resources-plugin</artifactId>
+ <version>@project.version@</version>
+ <configuration>
+ <fileNameFiltering>true</fileNameFiltering>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+</project>
Added: maven/plugins/trunk/maven-resources-plugin/src/it/filter-filenames/src/main/resources/${project.artifactId}.txt
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-resources-plugin/src/it/filter-filenames/src/main/resources/%24%7Bproject.artifactId%7D.txt?rev=1718087&view=auto
==============================================================================
--- maven/plugins/trunk/maven-resources-plugin/src/it/filter-filenames/src/main/resources/${project.artifactId}.txt (added)
+++ maven/plugins/trunk/maven-resources-plugin/src/it/filter-filenames/src/main/resources/${project.artifactId}.txt Sat Dec 5 14:20:44 2015
@@ -0,0 +1,3 @@
+${project.groupId}
+${project.version}
+${project.artifactId}
Added: maven/plugins/trunk/maven-resources-plugin/src/it/filter-filenames/src/main/resources/${project.version}.txt
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-resources-plugin/src/it/filter-filenames/src/main/resources/%24%7Bproject.version%7D.txt?rev=1718087&view=auto
==============================================================================
--- maven/plugins/trunk/maven-resources-plugin/src/it/filter-filenames/src/main/resources/${project.version}.txt (added)
+++ maven/plugins/trunk/maven-resources-plugin/src/it/filter-filenames/src/main/resources/${project.version}.txt Sat Dec 5 14:20:44 2015
@@ -0,0 +1,3 @@
+${project.groupId}
+${project.version}
+${project.artifactId}
Added: maven/plugins/trunk/maven-resources-plugin/src/it/filter-filenames/verify.groovy
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-resources-plugin/src/it/filter-filenames/verify.groovy?rev=1718087&view=auto
==============================================================================
--- maven/plugins/trunk/maven-resources-plugin/src/it/filter-filenames/verify.groovy (added)
+++ maven/plugins/trunk/maven-resources-plugin/src/it/filter-filenames/verify.groovy Sat Dec 5 14:20:44 2015
@@ -0,0 +1,36 @@
+/*
+ * 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.
+ */
+def fileName = '1.0-SNAPSHOT.txt'
+def targetClassFolder = 'target/classes/'
+assert new File(basedir, targetClassFolder + fileName).exists();
+
+content = new File(basedir, targetClassFolder + fileName).text;
+assert content.contains( 'org.apache.maven.plugins');
+assert content.contains( 'maven-resources-plugin-it-filter-filenames');
+assert content.contains( '1.0-SNAPSHOT');
+
+fileName = 'maven-resources-plugin-it-filter-filenames.txt'
+assert new File(basedir, targetClassFolder + fileName).exists();
+
+content = new File(basedir, targetClassFolder + fileName).text;
+assert content.contains( 'org.apache.maven.plugins');
+assert content.contains( 'maven-resources-plugin-it-filter-filenames');
+assert content.contains( '1.0-SNAPSHOT');
+
+return true;
Modified: maven/plugins/trunk/maven-resources-plugin/src/main/java/org/apache/maven/plugin/resources/ResourcesMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-resources-plugin/src/main/java/org/apache/maven/plugin/resources/ResourcesMojo.java?rev=1718087&r1=1718086&r2=1718087&view=diff
==============================================================================
--- maven/plugins/trunk/maven-resources-plugin/src/main/java/org/apache/maven/plugin/resources/ResourcesMojo.java (original)
+++ maven/plugins/trunk/maven-resources-plugin/src/main/java/org/apache/maven/plugin/resources/ResourcesMojo.java Sat Dec 5 14:20:44 2015
@@ -236,7 +236,7 @@ public class ResourcesMojo
/**
* Support filtering of filenames folders etc.
*
- * @since 2.8
+ * @since 3.0.0
*/
@Parameter( defaultValue = "false" )
private boolean fileNameFiltering;