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 2014/12/12 20:08:06 UTC

svn commit: r1645035 - in /maven/plugins/trunk/maven-ear-plugin: pom.xml src/main/java/org/apache/maven/plugin/ear/EarMojo.java

Author: khmarbaise
Date: Fri Dec 12 19:08:05 2014
New Revision: 1645035

URL: http://svn.apache.org/r1645035
Log:
[MEAR-176] Upgrading maven-filtering breaks IT

Modified:
    maven/plugins/trunk/maven-ear-plugin/pom.xml
    maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/EarMojo.java

Modified: maven/plugins/trunk/maven-ear-plugin/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/pom.xml?rev=1645035&r1=1645034&r2=1645035&view=diff
==============================================================================
--- maven/plugins/trunk/maven-ear-plugin/pom.xml (original)
+++ maven/plugins/trunk/maven-ear-plugin/pom.xml Fri Dec 12 19:08:05 2014
@@ -1,25 +1,26 @@
 <?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
+  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.
+  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">
+<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>
 
   <parent>
@@ -76,7 +77,7 @@ under the License.
 
   <properties>
     <mavenArchiverVersion>2.6</mavenArchiverVersion>
-    <mavenFilteringVersion>1.0-beta-2</mavenFilteringVersion>
+    <mavenFilteringVersion>1.3</mavenFilteringVersion>
     <mavenVersion>2.2.1</mavenVersion>
   </properties>
 
@@ -126,13 +127,11 @@ under the License.
       <artifactId>maven-filtering</artifactId>
       <version>${mavenFilteringVersion}</version>
     </dependency>
-    <!--
     <dependency>
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-interpolation</artifactId>
-      <version>1.21</version>
+      <version>1.22</version>
     </dependency>
-    -->
     <dependency>
       <groupId>org.apache.maven.shared</groupId>
       <artifactId>maven-verifier</artifactId>
@@ -169,18 +168,18 @@ under the License.
           <configuration>
             <excludes combine.children="append">
               <!--
-                The manifest specification does not describe any method for writing comments into the manifest.
+                ! The manifest specification does not describe any method for writing comments into the manifest.
               -->
               <exclude>src/test/resources/projects/project-015/src/main/application/META-INF/MANIFEST.MF</exclude>
               <exclude>src/test/resources/projects/project-016/src/main/ear/MANIFEST.MF</exclude>
               <!--
-                Added the following excludes cause they have been reported as wrong.
-                https://issues.apache.org/jira/browse/RAT-187
+                ! Added the following excludes cause they have been reported as wrong.
+                ! https://issues.apache.org/jira/browse/RAT-187
               -->
               <exclude>src/test/resources/m2repo/eartest/har-sample-one/1.0/har-sample-one-1.0.har</exclude>
               <exclude>src/test/resources/m2repo/eartest/sar-sample-one/1.0/sar-sample-one-1.0.sar</exclude>
               <!--
-                DTDs from other sources - do not add our own license header.
+                ! DTDs from other sources - do not add our own license header.
               -->
               <exclude>src/test/resources/dtd/application_1_3.dtd</exclude>
               <exclude>src/test/resources/dtd/jboss-app_3_2.dtd</exclude>

Modified: maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/EarMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/EarMojo.java?rev=1645035&r1=1645034&r2=1645035&view=diff
==============================================================================
--- maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/EarMojo.java (original)
+++ maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/EarMojo.java Fri Dec 12 19:08:05 2014
@@ -48,6 +48,7 @@ import org.apache.maven.shared.filtering
 import org.apache.maven.shared.filtering.MavenFilteringException;
 import org.apache.maven.shared.filtering.MavenResourcesExecution;
 import org.apache.maven.shared.filtering.MavenResourcesFiltering;
+import org.apache.maven.shared.utils.io.FileUtils;
 import org.codehaus.plexus.archiver.Archiver;
 import org.codehaus.plexus.archiver.ArchiverException;
 import org.codehaus.plexus.archiver.UnArchiver;
@@ -60,7 +61,6 @@ import org.codehaus.plexus.archiver.mana
 import org.codehaus.plexus.archiver.zip.ZipArchiver;
 import org.codehaus.plexus.archiver.zip.ZipUnArchiver;
 import org.codehaus.plexus.util.DirectoryScanner;
-import org.codehaus.plexus.util.FileUtils;
 import org.codehaus.plexus.util.StringUtils;
 
 /**
@@ -69,9 +69,9 @@ import org.codehaus.plexus.util.StringUt
  * @author <a href="snicoll@apache.org">Stephane Nicoll</a>
  * @version $Id$
  */
-@Mojo( 
-       name = "ear", defaultPhase = LifecyclePhase.PACKAGE, 
-       threadSafe = true, requiresDependencyResolution = ResolutionScope.TEST )
+// CHECKSTYLE_OFF: LineLength
+@Mojo( name = "ear", defaultPhase = LifecyclePhase.PACKAGE, threadSafe = true, requiresDependencyResolution = ResolutionScope.TEST )
+// CHECKSTYLE_ON: LineLength
 public class EarMojo
     extends AbstractEarMojo
 {
@@ -107,7 +107,7 @@ public class EarMojo
      * @since 2.3.2
      */
     @Parameter
-    private List filters;
+    private List<String> filters;
 
     /**
      * A list of file extensions that should not be filtered if filtering is enabled.
@@ -251,7 +251,7 @@ public class EarMojo
     @Parameter( defaultValue = "${session}", readonly = true, required = true )
     private MavenSession session;
 
-    private List filterWrappers;
+    private List<FileUtils.FilterWrapper> filterWrappers;
 
     /**
      * @since 2.9
@@ -664,6 +664,7 @@ public class EarMojo
             {
                 target.getParentFile().mkdirs();
             }
+
             mavenFileFilter.copyFile( source, target, true, getFilterWrappers(), null );
         }
         else
@@ -677,7 +678,7 @@ public class EarMojo
         return !mavenResourcesFiltering.filteredFileExtension( fileName, nonFilteredFileExtensions );
     }
 
-    private List getFilterWrappers()
+    private List<FileUtils.FilterWrapper> getFilterWrappers()
         throws MojoExecutionException
     {
         if ( filterWrappers == null )
@@ -685,10 +686,12 @@ public class EarMojo
             try
             {
                 MavenResourcesExecution mavenResourcesExecution = new MavenResourcesExecution();
+                mavenResourcesExecution.setMavenProject( getProject() );
+                mavenResourcesExecution.setEscapedBackslashesInFilePath( escapedBackslashesInFilePath );
+                mavenResourcesExecution.setFilters( filters );
                 mavenResourcesExecution.setEscapeString( escapeString );
-                filterWrappers =
-                    mavenFileFilter.getDefaultFilterWrappers( project, filters, escapedBackslashesInFilePath,
-                                                              this.session, mavenResourcesExecution );
+
+                filterWrappers = mavenFileFilter.getDefaultFilterWrappers( mavenResourcesExecution );
             }
             catch ( MavenFilteringException e )
             {