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 2009/09/28 14:14:05 UTC

svn commit: r819507 - in /maven/plugins/trunk/maven-resources-plugin/src: it/MRESOURCES-106/ it/MRESOURCES-106/src/ it/MRESOURCES-106/src/main/ it/MRESOURCES-106/src/main/resources/ main/java/org/apache/maven/plugin/resources/

Author: bentmann
Date: Mon Sep 28 12:14:04 2009
New Revision: 819507

URL: http://svn.apache.org/viewvc?rev=819507&view=rev
Log:
[MRESOURCES-106] Plugin does not respect escapeWindowsPaths default-value
Submitted by: Marvin Froeder

Added:
    maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-106/
    maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-106/pom.xml   (with props)
    maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-106/src/
    maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-106/src/main/
    maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-106/src/main/resources/
    maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-106/src/main/resources/file.txt   (with props)
    maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-106/src/main/resources/filter.properties   (with props)
    maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-106/verify.bsh   (with props)
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/MRESOURCES-106/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-106/pom.xml?rev=819507&view=auto
==============================================================================
--- maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-106/pom.xml (added)
+++ maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-106/pom.xml Mon Sep 28 12:14:04 2009
@@ -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>MSHARED-106</artifactId>
+  <packaging>jar</packaging>
+  <version>1.0-SNAPSHOT</version>
+
+  <build>
+    <resources>
+      <resource>
+        <directory>src/main/resources</directory>
+        <filtering>true</filtering>
+      </resource>
+    </resources>
+    <plugins>
+      <plugin>
+        <artifactId>maven-resources-plugin</artifactId>
+        <version>@pom.version@</version>
+      </plugin>
+    </plugins>
+  </build>
+
+  <properties>
+    <location>${basedir}/src/main/resources/file.txt</location>
+  </properties>
+
+</project>

Propchange: maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-106/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-106/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-106/src/main/resources/file.txt
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-106/src/main/resources/file.txt?rev=819507&view=auto
==============================================================================
--- maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-106/src/main/resources/file.txt (added)
+++ maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-106/src/main/resources/file.txt Mon Sep 28 12:14:04 2009
@@ -0,0 +1 @@
+Dummy content

Propchange: maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-106/src/main/resources/file.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-106/src/main/resources/file.txt
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-106/src/main/resources/filter.properties
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-106/src/main/resources/filter.properties?rev=819507&view=auto
==============================================================================
--- maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-106/src/main/resources/filter.properties (added)
+++ maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-106/src/main/resources/filter.properties Mon Sep 28 12:14:04 2009
@@ -0,0 +1,2 @@
+location=${location}
+basedir=${basedir}

Propchange: maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-106/src/main/resources/filter.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-106/src/main/resources/filter.properties
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-106/verify.bsh
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-106/verify.bsh?rev=819507&view=auto
==============================================================================
--- maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-106/verify.bsh (added)
+++ maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-106/verify.bsh Mon Sep 28 12:14:04 2009
@@ -0,0 +1,73 @@
+
+/*
+ * 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 java.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/filter.properties" );
+    if ( !someResource.exists() || !someResource.isFile() )
+    {
+        System.err.println( "file.txt is missing or not a file." );
+        return false;
+    }    
+    
+    FileInputStream fis = new FileInputStream( someResource );
+    Properties p = new Properties();
+    p.load( fis );
+
+    File f = new File( p.getProperty( "location" ) );
+    if ( !f.exists() )
+    {
+        System.err.println( "Property was not correctly filtered: " + f + "\n" + f.getAbsolutePath() );
+        result = false;
+    }
+
+    File basedir = new File( p.getProperty( "basedir" ) );
+    if ( !basedir.exists() )
+    {
+        System.err.println( "Property was not correctly filtered: " + basedir + "\n" + basedir.getAbsolutePath() );
+        result = false;
+    }
+
+    File expectedLocation = new File( basedir, "src/main/resources/file.txt" );
+    if ( !expectedLocation.equals( f ) )
+    {
+        System.err.println( "Files doesn't match:\n" + basedir + "\n" + expectedLocation );
+        result = false;
+    }
+}
+catch( IOException e )
+{
+    e.printStackTrace();
+    result = false;
+}
+
+return result;

Propchange: maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-106/verify.bsh
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-resources-plugin/src/it/MRESOURCES-106/verify.bsh
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

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=819507&r1=819506&r2=819507&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 Mon Sep 28 12:14:04 2009
@@ -167,7 +167,7 @@
     
     /**
      * Whether to escape backslashes and colons in windows-style paths.
-     * @parameter expression="${maven.resources.escapeWindowsPaths} default-value="true"
+     * @parameter expression="${maven.resources.escapeWindowsPaths}" default-value="true"
      * @since 2.4
      */
     protected boolean escapeWindowsPaths;