You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by bi...@apache.org on 2012/08/31 03:24:32 UTC

svn commit: r1379246 - in /maven/plugins/trunk/maven-war-plugin/src/it/overlay-excludes: ./ war-common/ war-exclude-overlay/ war-filter-overlay/ war-overlay/ war-overlay/src/main/images/ war-overlay/src/main/resources/ war-overlay/src/main/webapp/lib/ ...

Author: bimargulies
Date: Fri Aug 31 01:24:31 2012
New Revision: 1379246

URL: http://svn.apache.org/viewvc?rev=1379246&view=rev
Log:
no jira: add an IT that proves that excludes work. They didn't seem to be working for me, 
so I coded this in an effort to isolate a problem.

Added:
    maven/plugins/trunk/maven-war-plugin/src/it/overlay-excludes/
      - copied from r1379242, maven/plugins/trunk/maven-war-plugin/src/it/MWAR-143/
    maven/plugins/trunk/maven-war-plugin/src/it/overlay-excludes/war-exclude-overlay/
      - copied from r1379242, maven/plugins/trunk/maven-war-plugin/src/it/MWAR-143/war-filter-overlay/
    maven/plugins/trunk/maven-war-plugin/src/it/overlay-excludes/war-overlay/
      - copied from r1379242, maven/plugins/trunk/maven-war-plugin/src/it/MWAR-143/war-common/
    maven/plugins/trunk/maven-war-plugin/src/it/overlay-excludes/war-overlay/src/main/webapp/lib/
    maven/plugins/trunk/maven-war-plugin/src/it/overlay-excludes/war-overlay/src/main/webapp/lib/js/
    maven/plugins/trunk/maven-war-plugin/src/it/overlay-excludes/war-overlay/src/main/webapp/lib/js/something/
    maven/plugins/trunk/maven-war-plugin/src/it/overlay-excludes/war-overlay/src/main/webapp/lib/js/something/else.js   (with props)
Removed:
    maven/plugins/trunk/maven-war-plugin/src/it/overlay-excludes/war-common/
    maven/plugins/trunk/maven-war-plugin/src/it/overlay-excludes/war-filter-overlay/
    maven/plugins/trunk/maven-war-plugin/src/it/overlay-excludes/war-overlay/src/main/images/
    maven/plugins/trunk/maven-war-plugin/src/it/overlay-excludes/war-overlay/src/main/resources/
Modified:
    maven/plugins/trunk/maven-war-plugin/src/it/overlay-excludes/pom.xml
    maven/plugins/trunk/maven-war-plugin/src/it/overlay-excludes/verify.bsh
    maven/plugins/trunk/maven-war-plugin/src/it/overlay-excludes/war-exclude-overlay/pom.xml
    maven/plugins/trunk/maven-war-plugin/src/it/overlay-excludes/war-overlay/pom.xml

Modified: maven/plugins/trunk/maven-war-plugin/src/it/overlay-excludes/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-war-plugin/src/it/overlay-excludes/pom.xml?rev=1379246&r1=1379242&r2=1379246&view=diff
==============================================================================
--- maven/plugins/trunk/maven-war-plugin/src/it/overlay-excludes/pom.xml (original)
+++ maven/plugins/trunk/maven-war-plugin/src/it/overlay-excludes/pom.xml Fri Aug 31 01:24:31 2012
@@ -22,37 +22,23 @@ under the License.
          xmlns='http://maven.apache.org/POM/4.0.0'>
   <modelVersion>4.0.0</modelVersion>
   <groupId>debug.war</groupId>
-  <artifactId>MWAR-143</artifactId>
+  <artifactId>overlay-excludes</artifactId>
   <packaging>pom</packaging>
   <version>1.0-SNAPSHOT</version>
-  <name>MWAR-143 Maven Webapp</name>
+  <name>test of overlay with exclusions</name>
   <url>http://maven.apache.org</url>
+  <modules>
+    <module>war-overlay</module>
+    <module>war-exclude-overlay</module>
+  </modules>
   <build>
     <pluginManagement>
       <plugins>
         <plugin>
           <artifactId>maven-war-plugin</artifactId>
           <version>@pom.version@</version>
-          <configuration>
-            <nonFilteredFileExtensions>
-              <nonFilteredFileExtension>jpg</nonFilteredFileExtension>
-            </nonFilteredFileExtensions>
-          </configuration>
         </plugin>
       </plugins>
     </pluginManagement>
   </build>
-  <modules>
-    <module>war-common</module>
-    <module>war-filter-overlay</module>
-  </modules>
-  <dependencyManagement>
-    <dependencies>
-      <dependency>
-        <groupId>debug.war</groupId>
-        <artifactId>common-overlay</artifactId>
-        <version>1.0-SNAPSHOT</version>
-      </dependency>
-    </dependencies>
-  </dependencyManagement>
 </project>

Modified: maven/plugins/trunk/maven-war-plugin/src/it/overlay-excludes/verify.bsh
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-war-plugin/src/it/overlay-excludes/verify.bsh?rev=1379246&r1=1379242&r2=1379246&view=diff
==============================================================================
--- maven/plugins/trunk/maven-war-plugin/src/it/overlay-excludes/verify.bsh (original)
+++ maven/plugins/trunk/maven-war-plugin/src/it/overlay-excludes/verify.bsh Fri Aug 31 01:24:31 2012
@@ -21,104 +21,11 @@
 import java.io.*;
 import org.codehaus.plexus.util.*;
 
-boolean result = true;
 
-filesAreIdentical( File expected, File current )
-    throws IOException
-{
-    if ( expected.length() != current.length() )
+    File testFile = new File( basedir, "war-exclude-overlay/target/war-exclude-overlay-1.0-SNAPSHOT/lib/js/something/else.js");
+    if ( testFile.exists() )
     {
+        System.err.println( "exclude didn't exclude." );
         return false;
     }
-    FileInputStream expectedIn = new FileInputStream( expected );
-    FileInputStream currentIn = new FileInputStream( current );
-    try
-    {
-        byte[] expectedBuffer = IOUtil.toByteArray( expectedIn );
-
-        byte[] currentBuffer = IOUtil.toByteArray( currentIn );
-        if ( expectedBuffer.length != currentBuffer.length )
-        {
-            return false;
-        }
-        for ( int i = 0,size = expectedBuffer.length; i<size; i++ )
-        {
-            if ( expectedBuffer[i] != currentBuffer[i] )
-            {
-                return false;
-            }
-        }
-    }
-    finally
-    {
-        expectedIn.close();
-        currentIn.close();
-    }
-    return true;
-}
-
-try
-{
-
-    File originalImg = new File( basedir, "war-common/src/main/images/duke-beer.jpg" );
-
-    File targetImg = new File( basedir, "war-common/target/common-overlay-1.0-SNAPSHOT/duke-beer.jpg" );
-
-    boolean identical = filesAreIdentical( originalImg, targetImg );
-
-    if ( !identical )
-    {
-        System.err.println( "filtered images are not identical in war-common." );
-        return false;
-    }
-
-    File target = new File( basedir, "war-filter-overlay/target" );
-    if ( !target.exists() || !target.isDirectory() )
-    {
-        System.err.println( "target file is missing or not a directory." );
-        return false;
-    }
-
-    File webappDirectory = new File( target, "custom-manifest-1.0-SNAPSHOT" );
-    if ( !webappDirectory.exists() || !webappDirectory.isDirectory() )
-    {
-        System.err.println( "webappDirectory is missing or not a directory." );
-        return false;
-    }
-
-    File param = new File( webappDirectory, "WEB-INF/classes/filter.properties" );
-    if ( !param.exists() || param.isDirectory() )
-    {
-        System.err.println( "filter.properties file is missing or a directory." );
-        return false;
-    }
-
-
-    String paramContent = FileUtils.fileRead( param );
-
-    int indexOf = paramContent.indexOf( "debug.test = hello world !" );
-    if ( indexOf < 0 )
-    {
-        System.err.println( "filter.properties does not contains debug.test = hello world !" );
-        return false;
-    }
-
-    targetImg = new File( basedir, "war-filter-overlay/target/custom-manifest-1.0-SNAPSHOT/duke-beer.jpg" );
-
-    boolean identical = filesAreIdentical( originalImg, targetImg );
-
-    if ( !identical )
-    {
-        System.err.println( "filtered images are not identical with overlay." );
-        return false;
-    }
-
-}
-catch( Throwable e )
-{
-    e.printStackTrace();
-    result = false;
-}
-
-return result;
 

Modified: maven/plugins/trunk/maven-war-plugin/src/it/overlay-excludes/war-exclude-overlay/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-war-plugin/src/it/overlay-excludes/war-exclude-overlay/pom.xml?rev=1379246&r1=1379242&r2=1379246&view=diff
==============================================================================
--- maven/plugins/trunk/maven-war-plugin/src/it/overlay-excludes/war-exclude-overlay/pom.xml (original)
+++ maven/plugins/trunk/maven-war-plugin/src/it/overlay-excludes/war-exclude-overlay/pom.xml Fri Aug 31 01:24:31 2012
@@ -22,17 +22,17 @@ under the License.
   <modelVersion>4.0.0</modelVersion>
   <parent>
     <groupId>debug.war</groupId>
-    <artifactId>MWAR-143</artifactId>
+    <artifactId>overlay-excludes</artifactId>
     <version>1.0-SNAPSHOT</version>
   </parent>  
-  <artifactId>custom-manifest</artifactId>
+  <artifactId>war-exclude-overlay</artifactId>
   <packaging>war</packaging>
 
   <dependencies> 
     <!-- War Overlay -->
     <dependency>
       <groupId>debug.war</groupId>
-      <artifactId>common-overlay</artifactId>
+      <artifactId>war-overlay</artifactId>
       <version>1.0-SNAPSHOT</version>
       <type>war</type>
       <scope>runtime</scope>
@@ -48,18 +48,14 @@ under the License.
             <overlays>
               <overlay>
                 <groupId>debug.war</groupId>
-                <artifactId>common-overlay</artifactId>
-                <!--targetPath>filter</targetPath-->
-                <filtered>true</filtered>
+                <artifactId>war-overlay</artifactId>
+                <excludes>
+                  <exclude>lib/js/**</exclude>
+                </excludes>
               </overlay>
             </overlays>
         </configuration>
       </plugin>
     </plugins>
   </build>
-  
-  <properties>
-     <my.filter.value>hello world !</my.filter.value>
-  </properties>
-  
 </project>

Modified: maven/plugins/trunk/maven-war-plugin/src/it/overlay-excludes/war-overlay/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-war-plugin/src/it/overlay-excludes/war-overlay/pom.xml?rev=1379246&r1=1379242&r2=1379246&view=diff
==============================================================================
--- maven/plugins/trunk/maven-war-plugin/src/it/overlay-excludes/war-overlay/pom.xml (original)
+++ maven/plugins/trunk/maven-war-plugin/src/it/overlay-excludes/war-overlay/pom.xml Fri Aug 31 01:24:31 2012
@@ -22,31 +22,9 @@ under the License.
   <modelVersion>4.0.0</modelVersion>
   <parent>
     <groupId>debug.war</groupId>
-    <artifactId>MWAR-143</artifactId>
+    <artifactId>overlay-excludes</artifactId>
     <version>1.0-SNAPSHOT</version>
   </parent>
-  <artifactId>common-overlay</artifactId>
+  <artifactId>war-overlay</artifactId>
   <packaging>war</packaging>
-  
-  <build>
-    <plugins>
-        <plugin>
-          <groupId>org.apache.maven.plugins</groupId>
-          <artifactId>maven-war-plugin</artifactId>
-          <configuration>
-            <archive>
-              <manifestEntries>
-                <Class-Path>properties</Class-Path>
-              </manifestEntries>
-            </archive>
-            <webResources>
-              <resource>
-                <directory>src/main/images</directory>
-                <filtering>true</filtering>
-              </resource>
-            </webResources>
-          </configuration>
-        </plugin>
-    </plugins>
-  </build>
 </project>

Added: maven/plugins/trunk/maven-war-plugin/src/it/overlay-excludes/war-overlay/src/main/webapp/lib/js/something/else.js
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-war-plugin/src/it/overlay-excludes/war-overlay/src/main/webapp/lib/js/something/else.js?rev=1379246&view=auto
==============================================================================
--- maven/plugins/trunk/maven-war-plugin/src/it/overlay-excludes/war-overlay/src/main/webapp/lib/js/something/else.js (added)
+++ maven/plugins/trunk/maven-war-plugin/src/it/overlay-excludes/war-overlay/src/main/webapp/lib/js/something/else.js Fri Aug 31 01:24:31 2012
@@ -0,0 +1 @@
+/* a javascript file, sort of */

Propchange: maven/plugins/trunk/maven-war-plugin/src/it/overlay-excludes/war-overlay/src/main/webapp/lib/js/something/else.js
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-war-plugin/src/it/overlay-excludes/war-overlay/src/main/webapp/lib/js/something/else.js
------------------------------------------------------------------------------
    svn:mime-type = text/plain