Options:

1) Don't work directly out of workspace, but have your IDE
transparently copy the necessary files around behind you.  To allow
filtering, your IDE would have to do the filtering on the fly too.  Or
it would have to work out of the target directory, and copy all source
changes, including JSPs, on the fly behind you.  Eclipse Web Tools
Project already can copy source files to a Tomcat directory on a
automatic basis.  If it could work out of your taget directory,
instead of Tomcat's webapp directory, this might address the problem.

2) Use a web.xml (applicable to all other source files too) in your
src tree without filters.   In other words, use the version for Tomcat
directly.  Then, instead of filtering as part of your build, you'd
need a build plugin that modfied your web.xml to replace values
without requiring filter tokens.  For XML, use XPath to target the
element to replace a value in.  However, this plugin doesn't exist. 
If I ever find time, I'll learn how to write a Maven plugin, then work
an XPath replacement plugin.

Obviously, the second path is the one I'm leaning towards going down.
Mostly because it fixes the issue in Maven, instead of in a particualr
IDE, preserving IDE choice.

My post on this issue recently:

http://www.nabble.com/Advanced-File-Modification-Plugins-%28XSLT%2C-XSLT-Replacement%2C-Regular-Expression-Replacement%29-t898193.html#a2328248

-Stephen

On 1/23/06, KC Baltz <[EMAIL PROTECTED]> wrote:
> I'd like to convert our project to use M2 for web app development and I've 
> run into a bit of a snag.  Right now, we use Eclipse with the Sysdeo plugin 
> so we can run our webapp in Tomcat, directly from Eclipse without any sort of 
> deployment/copying steps.  The files we edit are the ones Tomcat is using.  
> This is great because we can edit JSPs and see the changes take place 
> immediately.  I don't want to give up this behavior.
>
> Here's the problem:  We have some values in web.xml that we want to be 
> configured at build time via filtering.   We're currently using an Ant task 
> to copy, filter, and rename web.xml.template to web.xml.  In Maven, the best 
> practice seems to be to not have a rename step, but I can't see how to make 
> this work with an in-place deployment.  I need to have an unfiltered version 
> of web.xml for CVS, and a filtered version for running in Tomcat.
>
> Obviously, I could point Tomcat at the /target/MyProject directory and run it 
> from there, but then any changes I made to JSPs would need to be copied back 
> to the /src tree to commit them to CVS.
>
> Is anyone doing something like this?  Can you suggest a fix?
>
> K.C.
>
>


--
Stephen Duncan Jr
www.stephenduncanjr.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to