Daniel Kulp wrote:
After battling with the braindead resource filtering once again for the
ump-teenth time, I've decided I need to do something about it....
You dissin' my code huh? :)
The main thing I'd like to do is allow use of a better filter engine
(like velocity) that would provide much more flexibility. The issue is
how to do it without breaking all the existing builds that are out
there. Here are my thoughts....
I'd very much like to know what the problems are. Probably the fact
that escaping is missing?
1) Ideally to me, we'd add a "filterType" element to the Resource type in
maven-model. It would default to "simple" (the existing
implementation) if unspecified. We could support "velocity" and others
in the future. This way, a single project could have some resource
directories filtering with velocity, others with the old stuff, etc...
You also wouldn't need to configure the resources plugin directly just
like you don't need to now. The major downside to this is it requires
a (backwords compatible) change to the schema and of course would
require maven 2.0.8 (assuming it's in place before 2.0.8 is released).
2) The next option would be to add a filterType configuration property
onto the resources plugin itself. You would need to configure the
plugin to use it. Also, it would apply to all resources with
filtering=true. We could combine this with (1) and instead of
making "simple" the default if not specified in the resource, whatever
this option is set to is the default.
This is a better option. the plugin can be configured with resource sets,
which are just initialized from the pom itself.
perhaps 'src/main/velocity/' could be checked by default and velocity-copied.
3) The other option would be to try something "automatic". Example: if
the file ends in ".vm", strip the .vm and filter with velocity. I
REALLY don't like this option (and it's also not really backwords
compatible).
No it isn't.. usually .vm files are used by the application itself so this
is definitely not the way. Even files with other extensions
may be used by the application itself as velocity templates.
Anyway, what are peoples thoughts on this? Any other options? What
direction do people feel is the best way to proceed? I personally
would like to go with Option #1 and require Maven 2.0.8 if you want to
use the advanced filtering, but I know some people are totally against
schema changes.
Well, if there's a good reason to change the schema then I'm all for it.
Maybe we should just add <properties> again to dependencies and resource
sets, so the resource plugin can look at the resourceset property 'filterType'
or something, if it's set.
Either way, changes to the model won't happen until 2.1.
So, what's the problem with the filtering?
-- Kenney
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]