You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by "Henning P. Schmiedehausen" <hp...@intermeta.de> on 2003/01/03 00:50:41 UTC

[BUG] Really, really stupid bug in WAR plugins

Cost me one fine evening figuring this out. =8-O

Someone really really owes me a beer for that. Admit it.  This was
never ever tested or used. :-)

--- cut ---
--- jakarta-turbine-maven/src/plugins-build/war/plugin.jelly~	Sat Nov 30 02:19:31 2002
+++ jakarta-turbine-maven/src/plugins-build/war/plugin.jelly	Fri Jan  3 00:32:46 2003
@@ -54,7 +54,7 @@
       <j:if test="${sourcesPresent == 'true'}">
         <classes dir="${maven.build.dest}">
           <include name="${maven.war.classes.includes}" />
-          <exclude name="${maven.war.classes.excludes} " />
+          <exclude name="${maven.war.classes.excludes}" />
         </classes>
       </j:if>
 
@@ -119,7 +119,7 @@
     <copy todir="${webapp.build.classes}">
       <fileset dir="${maven.build.dest}">
         <include name="${maven.war.classes.includes}" />
-        <exclude name="${maven.war.classes.excludes} " />
+        <exclude name="${maven.war.classes.excludes}" />
       </fileset>
     </copy>  
--- cut ---

This is from a slightly older maven CVS tree (2002-12-27) but the bug
is still in the CVS HEAD (just checked).

And if any maven developer will ever listen to one of their users,
here is a suggestion that I really would like to see in many plugins:

--- cut ---
--- jakarta-turbine-maven/src/plugins-build/war/plugin.jelly	Fri Jan  3 00:32:46 2003
+++ /usr/share/maven/plugins/maven-war-plugin-1.2-SNAPSHOT/plugin.jelly	Fri Jan  3 00:31:22 2003
@@ -52,7 +52,7 @@
       </j:forEach>            
 
       <j:if test="${sourcesPresent == 'true'}">
-        <classes dir="${maven.build.dest}">
+        <classes dir="${maven.build.dest}" includeEmptyDirs="no">
           <include name="${maven.war.classes.includes}" />
           <exclude name="${maven.war.classes.excludes}" />
         </classes>
@@ -117,7 +117,7 @@
     </j:forEach>            
 
     <copy todir="${webapp.build.classes}">
-      <fileset dir="${maven.build.dest}">
+      <fileset dir="${maven.build.dest}" includeEmptyDirs="no">
         <include name="${maven.war.classes.includes}" />
         <exclude name="${maven.war.classes.excludes}" />
       </fileset>
--- cut ---

Or, at least, make includeEmptyDirs configureable. 

In my case, I roll all the classes of a project to a .jar file and
include no class files into my war. So I have

maven.war.classes.excludes=**/*.class

in my project.properties. After fixing the bug, I still end up with a
tree with lots of empty subdirectories. If I could say
"includeEmptyDirs="no", all would be fine (I have only a "classes"
directory where some resources are stored.

Does <classes> BTW support includeEmptyDirs? My patched version runs
but I didn't actually chased around the source code.

	Regards
		Henning



-- 
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen       -- Geschaeftsfuehrer
INTERMETA - Gesellschaft fuer Mehrwertdienste mbH     hps@intermeta.de

Am Schwabachgrund 22  Fon.: 09131 / 50654-0   info@intermeta.de
D-91054 Buckenhof     Fax.: 09131 / 50654-20