You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Brian Topping <to...@codehaus.org> on 2006/02/20 09:51:45 UTC
Resource Filtering for War Plugin
Hi folks,
I've been working on web resource filtering with the war plugin and
came across a consideration I'd like to ask of the group.
What do you think of the term "resources" in the context of a war?
To me, <resources> in the POM should be considered anything including
the webapp resources, not just classpath resources. I see this
because classpath resources could easily be added to $
{warSourceDirectory}/WEB-INF/classes and used from there.
In this manner, ${warSourceDirectory} could be filtered with the same
constructions people are used to with the resources plugin. This is
the way I initially expected things to work. Brett felt otherwise
when I talked to him on IRC, but he also said he doesn't do filtering
with webapp content and I ought to ask people who care a little bit
more about this subject.
OPTION 1:
<resources> are added to plugin configuration. Someone who wanted to
filter their webapp resources would need to add a complete
<resources> configuration to their POM, such as:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.0-beta-3-SNAPSHOT</version>
<configuration>
<resources>
<resource>
<directory>src/main/webapp/WEB-INF</directory>
<filtering>true</filtering>
</resource>
</resources>
<filters>
<filter>
<filterproperties>${basedir}/src/main/
webapp/WEB-INF/classes/build.properties</filterproperties>
</filter>
</filters>
</configuration>
</plugin>
In this configuration, we still have overlap with the
warSourceDirectory parameter to the war plugin and extra code needs
to be added to deal with the circumstance that either/both are
specified.
OPTION 2:
Existing semantics for the resource plugin are preserved, but
interpreted slightly differently based on the <packaging>. When
<packaging>war</packaging>, we treat the <resources> as components of
the webapp. I think this significantly simplifies the user experience.
Opinions?
Brian
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: Resource Filtering for War Plugin
Posted by Brian Topping <to...@codehaus.org>.
That's probably all we need to close discussion on it then.
Brett had the idea of doing <otherResources> as plugin
configuration. I'd rather err on the side of too verbose than
confuse people.
-b
On Feb 20, 2006, at 3:22 AM, Stephen Duncan wrote:
> I'm like Brett, I haven't needed filtering in the webapp source yet.
> But I think we'd need more details on how the second option would
> work. My initial thought is that treating classpath resources and
> webapp sources as "resources" is going to be really confusing...
>
> -Stephen
>
> On 2/20/06, Brian Topping <to...@codehaus.org> wrote:
>> Hi folks,
>>
>> I've been working on web resource filtering with the war plugin and
>> came across a consideration I'd like to ask of the group.
>>
>> What do you think of the term "resources" in the context of a war?
>> To me, <resources> in the POM should be considered anything including
>> the webapp resources, not just classpath resources. I see this
>> because classpath resources could easily be added to $
>> {warSourceDirectory}/WEB-INF/classes and used from there.
>>
>> In this manner, ${warSourceDirectory} could be filtered with the same
>> constructions people are used to with the resources plugin. This is
>> the way I initially expected things to work. Brett felt otherwise
>> when I talked to him on IRC, but he also said he doesn't do filtering
>> with webapp content and I ought to ask people who care a little bit
>> more about this subject.
>>
>> OPTION 1:
>>
>> <resources> are added to plugin configuration. Someone who wanted to
>> filter their webapp resources would need to add a complete
>> <resources> configuration to their POM, such as:
>>
>> <plugin>
>> <groupId>org.apache.maven.plugins</groupId>
>> <artifactId>maven-war-plugin</artifactId>
>> <version>2.0-beta-3-SNAPSHOT</version>
>> <configuration>
>> <resources>
>> <resource>
>> <directory>src/main/webapp/WEB-INF</directory>
>> <filtering>true</filtering>
>> </resource>
>> </resources>
>> <filters>
>> <filter>
>> <filterproperties>${basedir}/src/main/
>> webapp/WEB-INF/classes/build.properties</filterproperties>
>> </filter>
>> </filters>
>> </configuration>
>> </plugin>
>>
>> In this configuration, we still have overlap with the
>> warSourceDirectory parameter to the war plugin and extra code needs
>> to be added to deal with the circumstance that either/both are
>> specified.
>>
>> OPTION 2:
>>
>> Existing semantics for the resource plugin are preserved, but
>> interpreted slightly differently based on the <packaging>. When
>> <packaging>war</packaging>, we treat the <resources> as components of
>> the webapp. I think this significantly simplifies the user
>> experience.
>>
>> Opinions?
>>
>> Brian
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> For additional commands, e-mail: dev-help@maven.apache.org
>>
>>
>
>
> --
> Stephen Duncan Jr
> www.stephenduncanjr.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: Resource Filtering for War Plugin
Posted by Stephen Duncan <st...@gmail.com>.
I'm like Brett, I haven't needed filtering in the webapp source yet.
But I think we'd need more details on how the second option would
work. My initial thought is that treating classpath resources and
webapp sources as "resources" is going to be really confusing...
-Stephen
On 2/20/06, Brian Topping <to...@codehaus.org> wrote:
> Hi folks,
>
> I've been working on web resource filtering with the war plugin and
> came across a consideration I'd like to ask of the group.
>
> What do you think of the term "resources" in the context of a war?
> To me, <resources> in the POM should be considered anything including
> the webapp resources, not just classpath resources. I see this
> because classpath resources could easily be added to $
> {warSourceDirectory}/WEB-INF/classes and used from there.
>
> In this manner, ${warSourceDirectory} could be filtered with the same
> constructions people are used to with the resources plugin. This is
> the way I initially expected things to work. Brett felt otherwise
> when I talked to him on IRC, but he also said he doesn't do filtering
> with webapp content and I ought to ask people who care a little bit
> more about this subject.
>
> OPTION 1:
>
> <resources> are added to plugin configuration. Someone who wanted to
> filter their webapp resources would need to add a complete
> <resources> configuration to their POM, such as:
>
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-war-plugin</artifactId>
> <version>2.0-beta-3-SNAPSHOT</version>
> <configuration>
> <resources>
> <resource>
> <directory>src/main/webapp/WEB-INF</directory>
> <filtering>true</filtering>
> </resource>
> </resources>
> <filters>
> <filter>
> <filterproperties>${basedir}/src/main/
> webapp/WEB-INF/classes/build.properties</filterproperties>
> </filter>
> </filters>
> </configuration>
> </plugin>
>
> In this configuration, we still have overlap with the
> warSourceDirectory parameter to the war plugin and extra code needs
> to be added to deal with the circumstance that either/both are
> specified.
>
> OPTION 2:
>
> Existing semantics for the resource plugin are preserved, but
> interpreted slightly differently based on the <packaging>. When
> <packaging>war</packaging>, we treat the <resources> as components of
> the webapp. I think this significantly simplifies the user experience.
>
> Opinions?
>
> Brian
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>
--
Stephen Duncan Jr
www.stephenduncanjr.com
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: Resource Filtering for War Plugin
Posted by Brian Topping <to...@codehaus.org>.
Hmm, I see there's a longstanding issue with this... http://
jira.codehaus.org/browse/MWAR-12
I'd kind of like to solve this...
-b
On Feb 20, 2006, at 12:51 AM, Brian Topping wrote:
> Hi folks,
>
> I've been working on web resource filtering with the war plugin and
> came across a consideration I'd like to ask of the group.
>
> What do you think of the term "resources" in the context of a war?
> To me, <resources> in the POM should be considered anything
> including the webapp resources, not just classpath resources. I
> see this because classpath resources could easily be added to $
> {warSourceDirectory}/WEB-INF/classes and used from there.
>
> In this manner, ${warSourceDirectory} could be filtered with the
> same constructions people are used to with the resources plugin.
> This is the way I initially expected things to work. Brett felt
> otherwise when I talked to him on IRC, but he also said he doesn't
> do filtering with webapp content and I ought to ask people who care
> a little bit more about this subject.
>
> OPTION 1:
>
> <resources> are added to plugin configuration. Someone who wanted
> to filter their webapp resources would need to add a complete
> <resources> configuration to their POM, such as:
>
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-war-plugin</artifactId>
> <version>2.0-beta-3-SNAPSHOT</version>
> <configuration>
> <resources>
> <resource>
> <directory>src/main/webapp/WEB-INF</directory>
> <filtering>true</filtering>
> </resource>
> </resources>
> <filters>
> <filter>
> <filterproperties>${basedir}/src/main/
> webapp/WEB-INF/classes/build.properties</filterproperties>
> </filter>
> </filters>
> </configuration>
> </plugin>
>
> In this configuration, we still have overlap with the
> warSourceDirectory parameter to the war plugin and extra code needs
> to be added to deal with the circumstance that either/both are
> specified.
>
> OPTION 2:
>
> Existing semantics for the resource plugin are preserved, but
> interpreted slightly differently based on the <packaging>. When
> <packaging>war</packaging>, we treat the <resources> as components
> of the webapp. I think this significantly simplifies the user
> experience.
>
> Opinions?
>
> Brian
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org