I agree that putting <filtering> in the POM is a good first approach but
that it won't handle the need for different environments.

This is something that I've been wanted to include in maven for a very long
time: the ability to say "build me this project for this environment".

It seems that you're currently moving in the direction of doing this with
the settings.xml file. However I'm concerned that the definition of the
different environments is something that you need to share with your
co-workers so it can't be located in a file that contains machine-dependent
information such as (location of your local repo, etc). In other words parts
of the environment definition should be shared through the SCM and part
shouldn't.

I was going to propose a solution but I've just realized while writing it
that it needs more thinking... :-)

-Vincent

> -----Original Message-----
> From: Brett Porter [mailto:[EMAIL PROTECTED]
> Sent: dimanche 17 avril 2005 02:38
> To: Maven Developers List
> Subject: Re: [M2] Filter definition
> 
> 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]


_________________________________________________________________

Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !

Yahoo! Mail : http://fr.mail.yahoo.com


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

Reply via email to