Hi!

AFAIK, this only works _within_ the POM itself (i.e. in the configuration section of plugins). I don´t know if it works for the file-filtering stuff.

CU,

Gunther

Gareth Tilley schrieb:
Hi All,


Gunther Popp-2 wrote:
- All (platform-specific) Environment variables (Just add the prefix env. For example ${env.M2_HOME} returns the Maven2 installation path).


Has anyone actually been able to get this working? All of the filtering
works fine for me, but the environment variable stuff does not.  As a test I
have a properties file that contains:
${env.JAVA_HOME}
${user.home}
${pom.version}

After the process-resources phase (with filtering turn on in the pom), the
file looks like this:
${env.JAVA_HOME}
/home/build
1.2-SNAPSHOT

JAVA_HOME is definitely set, is there something I am doing wrong, or does
this just not work?

Regards
Gareth




Hi Andreas!

Take a look at the Getting Started Guide (http://maven.apache.org/guides/getting-started/index.html), section "How do I filter resource files?". It explains how to reference the elements of the pom.xml/settings.xml using property-names.

I´m currently working on a book that covers Maven 2 as part of a pragmatic configuration management process and have done some "research" concerning the usage of properties. AFAIK, properties are resolved in the following order:

- The (hard-coded) property ${basedir} (contains the path of the POM-file)
- All Java System Properties defined by the JVM.
- All properties defined in the properties-element of the POM.
- All elements in pom.xml and settings.xml as stated above
- All (platform-specific) Environment variables (Just add the prefix env. For example ${env.M2_HOME} returns the Maven2 installation path).

I´m not 100% sure about the list and appreciate any additions/corrections.

CU,

Gunther

---------------------------------------------------------------------
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]

Reply via email to