Author: olamy
Date: Wed Jun 20 15:23:54 2012
New Revision: 1352155
URL: http://svn.apache.org/viewvc?rev=1352155&view=rev
Log:
[MRESOURCES-166] Escaping on a line suppresses filtering for the rest of the
token/line.
upgrade to maven filtering 1.1-SNAPSHOT
Added:
maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-166/
maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-166/pom.xml
(with props)
maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-166/src/
maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-166/src/main/
maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-166/src/main/resources/
maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-166/src/main/resources/resource.txt
(with props)
maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-166/verify.bsh
(with props)
Modified:
maven/plugins/trunk/maven-resources-plugin/pom.xml
Modified: maven/plugins/trunk/maven-resources-plugin/pom.xml
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-resources-plugin/pom.xml?rev=1352155&r1=1352154&r2=1352155&view=diff
==============================================================================
--- maven/plugins/trunk/maven-resources-plugin/pom.xml (original)
+++ maven/plugins/trunk/maven-resources-plugin/pom.xml Wed Jun 20 15:23:54 2012
@@ -59,7 +59,7 @@ under the License.
</issueManagement>
<properties>
- <mavenFilteringVersion>1.0</mavenFilteringVersion>
+ <mavenFilteringVersion>1.1-SNAPSHOT</mavenFilteringVersion>
<mavenVersion>2.0.6</mavenVersion>
</properties>
Added: maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-166/pom.xml
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-166/pom.xml?rev=1352155&view=auto
==============================================================================
--- maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-166/pom.xml
(added)
+++ maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-166/pom.xml
Wed Jun 20 15:23:54 2012
@@ -0,0 +1,55 @@
+<?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-MRESOURCES-166</artifactId>
+ <packaging>jar</packaging>
+ <version>1.0-SNAPSHOT</version>
+
+ <properties>
+ <httpd.server.env>sandbox</httpd.server.env>
+ </properties>
+
+ <build>
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ <filtering>true</filtering>
+ </resource>
+ </resources>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-resources-plugin</artifactId>
+ <version>2.6-SNAPSHOT</version>
+ <configuration>
+ <supportMultiLineFiltering>true</supportMultiLineFiltering>
+ <escapeString>\</escapeString>
+ </configuration>
+
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+</project>
Propchange:
maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-166/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-166/pom.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added:
maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-166/src/main/resources/resource.txt
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-166/src/main/resources/resource.txt?rev=1352155&view=auto
==============================================================================
---
maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-166/src/main/resources/resource.txt
(added)
+++
maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-166/src/main/resources/resource.txt
Wed Jun 20 15:23:54 2012
@@ -0,0 +1,4 @@
+fileValue=${foo.file}
+export SERVER_ENV=\${SERVER_ENV:${httpd.server.env}}
+envserver=${httpd.server.env}
+bar=foo
\ No newline at end of file
Propchange:
maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-166/src/main/resources/resource.txt
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-166/src/main/resources/resource.txt
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added:
maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-166/verify.bsh
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-166/verify.bsh?rev=1352155&view=auto
==============================================================================
--- maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-166/verify.bsh
(added)
+++ maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-166/verify.bsh
Wed Jun 20 15:23:54 2012
@@ -0,0 +1,65 @@
+
+/*
+ * 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 java.io.*;
+
+import org.codehaus.plexus.util.*;
+
+boolean result = true;
+
+try
+{
+ File target = new File( basedir, "target" );
+ if ( !target.exists() || !target.isDirectory() )
+ {
+ System.err.println( "target file is missing or a directory." );
+ return false;
+ }
+
+ File someResource = new File( target, "/classes/resource.txt" );
+ if ( !someResource.exists() || someResource.isDirectory() )
+ {
+ System.err.println( "SomeResource.txt is missing or not a file." );
+ return false;
+ }
+
+ String paramContent = FileUtils.fileRead( someResource );
+
+ int indexOf = paramContent.indexOf( "fileValue=${foo.file}" );
+ if ( indexOf < 0 )
+ {
+ System.err.println( "SomeResource.txt not contains
fileValue=${foo.file}" );
+ return false;
+ }
+
+ int indexOf = paramContent.indexOf( "export
SERVER_ENV=${SERVER_ENV:sandbox}" );
+ if ( indexOf < 0 )
+ {
+ System.err.println( "SomeResource.txt not contains export
SERVER_ENV=${SERVER_ENV:sandbox}" );
+ return false;
+ }
+}
+catch( IOException e )
+{
+ e.printStackTrace();
+ result = false;
+}
+
+return result;
Propchange:
maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-166/verify.bsh
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-166/verify.bsh
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision