On Today at 2:08am, GT=>Gareth Tilley <[EMAIL PROTECTED]> wrote: GT> GT> Hi All, GT> GT> Gunther Popp-2 wrote: GT> - All (platform-specific) Environment variables (Just add the prefix GT> env. For example ${env.M2_HOME} returns the Maven2 installation path). GT> GT> Has anyone actually been able to get this working? All of the filtering GT> works fine for me, but the environment variable stuff does not. As a test I GT> have a properties file that contains: GT> ${env.JAVA_HOME} GT> ${user.home} GT> ${pom.version} GT> GT> After the process-resources phase (with filtering turn on in the pom), the GT> file looks like this: GT> ${env.JAVA_HOME} GT> /home/build GT> 1.2-SNAPSHOT GT> GT> JAVA_HOME is definitely set, is there something I am doing wrong, or does GT> this just not work? GT> GT> Regards GT> Gareth GT>
Hi Gareth, Environment variables tend to be second-class citizens in my experience. See my earlier post about profile activation based on environment variables: http://www.nabble.com/profile-activation-based-on-environment-variables-t2585492s177.html In addition, looking at the source for ResourcesMojo.java http://svn.apache.org/viewvc/maven/plugins/trunk/maven-resources-plugin/src/main/java/org/apache/maven/plugin/resources/ResourcesMojo.java?revision=422969&view=markup we see that there is no mention of environment variables during filtering (just system properties and project properties): filterProperties = new Properties(); // System properties filterProperties.putAll( System.getProperties() ); // Project properties filterProperties.putAll( project.getProperties() ); I am not familiar with the maven codebase at all, but I might try my luck with figuring this out (when I get some spare time). Later, -- Haroon Rafique <[EMAIL PROTECTED]> --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]