You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Carlo Bonamico <c....@set-network.com> on 2007/07/26 12:00:23 UTC

External property files

Hi!
In the Maven2 documentation 
(http://maven.apache.org/pom.html#Properties) I read that properties can 
come from

   1. env.X: Prefixing a variable with "env." will return the shell’s
      environment variable. For example, ${env.PATH} contains the $path
      environment variable (%PATH% in Windows).
   2. project.x: A dot (.) notated path in the POM will contain the
      corresponding element’s value. For example:
      <project><version>1.0</version></project> is accessible via
      ${project.version}.
   3. settings.x: A dot (.) notated path in the settings.xml will
      contain the corresponding element’s value. For example:
      <settings><offline>false</offline></settings> is accessible via
      ${settings.offline}.
   4. Java System Properties: All properties accessible via
      java.lang.System.getProperties() are available as POM properties,
      such as ${java.home}.
   5. x: Set within a <properties /> element or an external files, the
      value may be used as ${someVar}.

but I could not find any reference on how to read properties from an 
external file (as it is mentioned in item 5) and avoid putting them in 
the POM <properties> section.

Is there any way to do that like it was possible with Maven 1.x 
(build.properties and project.properties files)?
Thanks for any help!
Carlo


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


Re: External property files

Posted by Maria Odea Ching <oc...@exist.com>.
Hi Carlo,

You may want to take a look at Maven 2's filters :-)
http://maven.apache.org/guides/getting-started/index.html#How%20do%20I%20filter%20resource%20files?

HTH,
Deng

Carlo Bonamico wrote:
> Hi!
> In the Maven2 documentation 
> (http://maven.apache.org/pom.html#Properties) I read that properties 
> can come from
>
>   1. env.X: Prefixing a variable with "env." will return the shell’s
>      environment variable. For example, ${env.PATH} contains the $path
>      environment variable (%PATH% in Windows).
>   2. project.x: A dot (.) notated path in the POM will contain the
>      corresponding element’s value. For example:
>      <project><version>1.0</version></project> is accessible via
>      ${project.version}.
>   3. settings.x: A dot (.) notated path in the settings.xml will
>      contain the corresponding element’s value. For example:
>      <settings><offline>false</offline></settings> is accessible via
>      ${settings.offline}.
>   4. Java System Properties: All properties accessible via
>      java.lang.System.getProperties() are available as POM properties,
>      such as ${java.home}.
>   5. x: Set within a <properties /> element or an external files, the
>      value may be used as ${someVar}.
>
> but I could not find any reference on how to read properties from an 
> external file (as it is mentioned in item 5) and avoid putting them in 
> the POM <properties> section.
>
> Is there any way to do that like it was possible with Maven 1.x 
> (build.properties and project.properties files)?
> Thanks for any help!
> Carlo
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


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