[ http://jira.codehaus.org/browse/MWAR-60?page=comments#action_73112 ] Fabrice BELLINGARD commented on MWAR-60: ----------------------------------------
Mike, I think Chuck is right. There should be 2 parameters: * one that filters files when they are copied from the source project (i.e. ${basedir}) to the exploded project (i.e. ${project.build.directory}/${project.build.finalName}) ** this is useful, for instance, if you want to exclude JARs stored in the SCM under WEB-INF/lib ** IMHO, this one should be the *warSourceExcludes* (as it used to work for version 2.0) * one that filters files when they are packaged from the exploded project to the WAR archive ** this is useful when you want to do your skinny WAR ** this one could be called *warExcludes*, as Chuck said Considering this, the patch applied for -[MWAR-39|http://jira.codehaus.org/browse/MWAR-39]- is not correct because it uses the same parameter to do both filtering. What's more, what is confusing is that "warSourceIncludes" has an alias, so people don't know that they are actually modifying the same parameter : {code:title=AbstractWarMojo.java|borderStyle=solid} ... /** * The comma separated list of tokens to exclude from the WAR. * * @parameter alias="excludes" */ private String warSourceExcludes; ... {code} We have to work on that. > Source Excludes are being applied to WAR file > --------------------------------------------- > > Key: MWAR-60 > URL: http://jira.codehaus.org/browse/MWAR-60 > Project: Maven 2.x War Plugin > Issue Type: Bug > Affects Versions: 2.0.1 > Environment: WinXP, jdk1.5.0_07, mvn 2.0.4 > Reporter: Chuck Deal > Fix For: 2.0.2 > > > My scenario: > I use Eclipse 3.1.1 to develop the web app. I run Tomcat 5.5.17 with it's > docbase pointed at the source tree (/src/main/webapp). As a result, I have > files that are required by Tomcat to run, but not to be included in the WAR. > Specifically, I have a WEB-INF folder with a classes directory that includes > classes that will actually be included in the WAR as a JAR (as well as a few > other things). > As you can see in the following plugin snippet, I specifically exclude the > WEB-INF folder from the source tree because all of its contents will be > gathered by the various stages of the build process (process-resources, etc) > and included in the WAR when it is "exploded" > I had been using the following plugin snippet for generating my War (war > plugin 2.0) > <plugin> > <groupId>org.apache.maven.plugins</groupId> > <artifactId>maven-war-plugin</artifactId> > <version>2.0</version> > <configuration> > <webXml>target/jspweb.xml</webXml> > <warName>aims</warName> > <excludes>**/*.jsp*, **/JasperReports/*.*, **/WEB-INF/**/*.*</excludes> > </configuration> > </plugin> > If you change the version from 2.0 to 2.0.1, you will no longer generate the > same WAR file! Instead, v2.0.1 uses the source excludes and applies them to > the WAR construction as well. This means that the exploded WEB-INF (the > correct one) is also removed from the WAR file. > I don't think that the source excludes should be applied to the WAR > construction, only to the stage where the source files are "exploded" (as in > v2.0) -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira