On 14-May-06, at 5:46 PM, Brett Porter wrote:
No, but there should be. We're no longer accepting patches like this
without docs.
I take it this doesn't apply to the war plugin release then? This
patch does not appear to have any docs, certainly not in the site
folder from svn. Nevertheless, this is excellent news!
It's basically a identical to a normal <resources> element, but inside
the plugin configuration.
So by that token, if you create the webapp archetype:
mvn archetype:create -DarchetypeGroupId=org.apache.maven.archetypes -
DarchetypeArtifactId=maven-archetype-webapp -DarchetypeVersion=1.0-
alpha-4 -DgroupId=ca.ucalgary.tlc -DartifactId=my-webapp
And then add this to the pom.xml:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.0</version>
<configuration>
<resources>
<resource>
<filtering>true</filtering>
<directory>${basedir}/src/main/webapp</
directory>
<includes>
<include>**/*.xml</include>
</includes>
</resource>
</resources>
</configuration>
</plugin>
</plugins>
</build>
And finally change the web.xml produced by the archetype so there is
something to filter:
<web-app>
<display-name>${project.name}</display-name>
</web-app>
You should get filtering, right? Doesn't work. But, place that
resources element inside the build element, and you will get
filtering as per normal. Changing the resources element in the plugin
configuration to a webResources element doesn't work either.
Has anyone got this working? What's the trick? (says I refusing to
look through source code).
Thanks, J
PS. I do regularly use the trick where you configure the war plugin
to use a resources directory which was the target of a regular
resource filtering process, and this works well, but adds a lot of
ambiguity to the pom.
PPS. http://jira.codehaus.org/browse/MWAR-12 has lots of hints, but
all to no avail.
- Brett
On 5/14/06, Nick Bolton <[EMAIL PROTECTED]> wrote:
Thanks, Brett. Are there any examples of how to use the webResources
element?
Thanks!
-nick
On 5/14/06 4:11 PM, "Brett Porter" <[EMAIL PROTECTED]> wrote:
> MPWAR is for the Maven1 plugin.
>
> You want to use the <webResources> element inside the WAR
plugin, new
> as of v2.0 released yesterday.
>
> - Brett
>
> On 5/14/06, Nick Bolton <[EMAIL PROTECTED]> wrote:
>> Hello list. :)
>>
>> I'm new to using maven2 and I'm having a problem using the
maven-war-plugin
>> plugin when files in the webapp directory are tokenized and I
want to have a
>> filter applied before they get war'ed. I see there's an issue
already -
>> MPWAR-46. Could someone point me to some documentation that
describes how
>> to apply what's given in MPWAR-46? I'm new to maven plugin
development.
>>
>> Also, as a workaround, I was trying to copy files with
filtering="on" using
>> the maven-antrun-plugin plugin into a different directory, then
specify that
>> directory as the warSourceDirectory attribute. But when
they're copied it
>> doesn't filter them with the filters specified in the <build>
element nor
>> with filtersets I place within the ant tasks.
>>
>> Is there a trick applying the filters within ant tasks that I'm
missing?
>>
>> TIA
>>
>> -nick
>>
>>
>>
>>
---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
Julian Wood <[EMAIL PROTECTED]>
Software Engineer
Teaching & Learning Centre
University of Calgary
http://tlc.ucalgary.ca
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]