You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "John J. Franey" <jj...@verizon.net> on 2007/02/28 19:46:34 UTC

Re: [m2] Filtering resources


Thierry Lach-2 wrote:
> 
> Actually settings properties not being available in filtering might cause
> us
> some problems in converting to M2.
> 

Properties in settings file are available in resource filtering using a
profile.

Each user should create a profile in their own settings.xml.  Their profile
defines user specific values for the property tokens (e.g., ${db.host} )
that are used in src/test/resources/build.properties.

A settings.xml sample:

<settings>
  <profiles>
    <profile>
       <id>myProfile</id>
       <properties>
         <db.host>localhost</db.host>
         <db.username>me</db.username>
         <db.password>mypassword</db.password>
      </properties>
   </profile
  </profiles>
</settings>

Then:  mvn -PmyProfile compile

The tokens: ${db.host}, ${db.username}, ${db.password} appearing in
build.properties will be replaced by the values above.

Each developer is required to define private values for these properties. 
However, the pom.xml can define default values for these properties and they
will be overridden by values in settings.xml.

For more details, see:
http://maven.apache.org/guides/introduction/introduction-to-profiles.html

Regards,
John


-- 
View this message in context: http://www.nabble.com/Filtering-resources-tf3307730s177.html#a9225896
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: [m2] Filtering resources

Posted by Thierry Lach <th...@gmail.com>.
Thanks for the clarification.  That will work well enough.

On 2/28/07, John J. Franey <jj...@verizon.net> wrote:
>
>
>
> Thierry Lach-2 wrote:
> >
> > Actually settings properties not being available in filtering might
> cause
> > us
> > some problems in converting to M2.
> >
>
> Properties in settings file are available in resource filtering using a
> profile.
>
> Each user should create a profile in their own settings.xml.  Their
> profile
> defines user specific values for the property tokens (e.g., ${db.host} )
> that are used in src/test/resources/build.properties.
>
> A settings.xml sample:
>
> <settings>
>   <profiles>
>     <profile>
>        <id>myProfile</id>
>        <properties>
>          <db.host>localhost</db.host>
>          <db.username>me</db.username>
>          <db.password>mypassword</db.password>
>       </properties>
>    </profile
>   </profiles>
> </settings>
>
> Then:  mvn -PmyProfile compile
>
> The tokens: ${db.host}, ${db.username}, ${db.password} appearing in
> build.properties will be replaced by the values above.
>
> Each developer is required to define private values for these properties.
> However, the pom.xml can define default values for these properties and
> they
> will be overridden by values in settings.xml.
>
> For more details, see:
> http://maven.apache.org/guides/introduction/introduction-to-profiles.html
>
> Regards,
> John
>
>
> --
> View this message in context:
> http://www.nabble.com/Filtering-resources-tf3307730s177.html#a9225896
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>