[ http://jira.codehaus.org/browse/MWAR-40?page=comments#action_65846 ]
Edwin Punzalan commented on MWAR-40:
------------------------------------
This took me a while... heheh
You should use this instead for your plugin configuration:
{code}
<plugins>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<warSourceDirectory>${project.build.directory}/filtered-webapp-resources</warSourceDirectory>
</configuration>
</plugin>
</plugins>
{code}
if you put it in goals, then the war plugin gets executed twice.... One with
the correct warSourceDirectory and the other with the unmodified
warSourceDirectory (which points to src/main/webapp) and would mostly overwrite
the contents of the other since their outputDirectory is the same.
If you'll look at the output of your build, you'll see two executions of the
war plugin,
[war:war]
and
[war:war{execution: default}]
> War plugin doesn't honour warSourceDirectory properly anymore
> -------------------------------------------------------------
>
> Key: MWAR-40
> URL: http://jira.codehaus.org/browse/MWAR-40
> Project: Maven 2.x War Plugin
> Type: Bug
> Versions: 2.0
> Environment: osx 10.4.6, java 1.4.2_06
> Reporter: Julian Wood
> Assignee: Edwin Punzalan
> Fix For: 2.0.1
>
>
> I have many released projects which won't build properly anymore because of
> this regression.
> The problem is that if you filter resources to a special dir, and then make
> that special dir the warSourceDirectory, it doesn't use those filtered files.
> You just get the original, unfiltered files.
> An example pom:
> <build>
> <resources>
> ...
> <resource>
> <targetPath>../filtered-webapp-resources</targetPath>
> <filtering>true</filtering>
> <directory>${basedir}/src/main/webapp</directory>
> <includes>
> <include>**/log4j.txt</include>
> <include>**/web.xml</include>
> </includes>
> </resource>
> </resources>
> <plugins>
> <plugin>
> <artifactId>maven-war-plugin</artifactId>
> <executions>
> <execution>
> <goals>
> <goal>war</goal>
> </goals>
> <configuration>
>
> <warSourceDirectory>${project.build.directory}/filtered-webapp-resources</warSourceDirectory>
> </configuration>
> </execution>
> </executions>
> </plugin>
> </plugins>
> </build>
> While ${project.build.directory}/filtered-webapp-resources has all the
> correctly filtered resource files, the war plugin seems to ignore its
> warSourceDirectory.
--
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