I think the following should be added to the resources section:
<filtering>
<properties>
<key>value</key>
<key2>value</key2>
</properties>
<propertyFiles>
<propertyFile>...</propertyFile>
</propertyFiles>
</filtering>
The resource patterns can take care of the includes/excludes.
I'm still apprehensive about including filtering at this stage though,
without some way of managing the environment differentiation. The above
is useful for centrally locating properties, but not changing them
through dev -> stage -> qa -> prod. And in particular, rebuilding with
different properties through those last 3 environments is a bit risky.
I've always seen it as a good practice to push all the
environment-specific configuration outside of the artifacts, and use a
configuration management tool.
So in short, I think I would like to add Kenney's patch to resources to
allow filtering through the resource plugin's configuration, with a view
to thinking this through more and eventually deprecating this and
including it in resources if applicable.
Any other thoughts?
Cheers,
Brett
Kenney Westerhof wrote:
>I got in a discussion with Brett about his comments on
>http://jira.codehaus.org/browse/MNG-178?page=comments#action_31997 .
>
>Short summary: i've created a patch for maven-resources-plugin that
>allows filtering while copying resources. It is enabled by default
>when a build.properties file is present, because the POM currently has
>no means of specifying what to filter and what not to filter.
>
>We've discussed the possibility of explicitly excluding
>resources from filtering (see the link), and explicitly stating filtering
>needs to take place, like maven 1 does (<filtering>true</filtering>).
>
>I think at least the <filtering/> tag needs to be included in the POM,
>and possibly a means for excluding too, although this is not strictly
>necessary since you can split up the resources into filtered and
>non-filtered.
>
>Brett also suggested that the filter file, and possibly the tokens,
>need to be defined in the POM.
>
>Since currently property files are ignored by maven (like
>build.properties, project.properties), we'll have to see if
>stating the filter file is going to be necessary. If property
>files are going to be supported, it's not.
>
>But I think it's a good idea to define the tokens in the POM,
>and avoid multiple files for a project.
>
>Comments, anyone?
>
>Greetings,
>
> Kenney Westerhof
>
>
>---------------------------------------------------------------------
>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]