Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 338072

Summary: ${env.VARIABLE} is not getting expanded
Product: z_Archived Reporter: Guillermo López <gmlopez.mackinnon>
Component: m2eAssignee: Igor Fedorenko <igor>
Status: CLOSED WORKSFORME QA Contact:
Severity: normal    
Priority: P3 CC: igor, martin.j.bartlett, pascal
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
sample project none

Description Guillermo López CLA 2011-02-24 07:17:48 EST
Build Identifier: 20100917-0705

User session variables set within your .bashrc are not getting expanded. 

Maven Integration for Eclipse	0.12.1.20110112-1712

> mvn -version
Apache Maven 2.2.1 (r801777; 2009-08-06 16:16:01-0300)
Java version: 1.6.0_24
Java home: /usr/lib/jvm/java-6-sun-1.6.0.24/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux" version: "2.6.35-25-generic" arch: "amd64" Family: "unix"

Reproducible: Always

Steps to Reproduce:
1. create a sample mvn project
2. set an environment variable CUSTOM_VAR within your .bashrc and then run $ . .bashrc
3. verify environment variable is set: echo $CUSTOM_VAR
4. create a sample mvn project
5. add maven-antrun-plugin with 2 executions echoing ${env.USER_VAR} and another system wide variable
6. run mvn test by right clicking on the project->Run as->Maven test
7. you'll see first execution just prints the text ("${env.CUSTOM_VAR}") and for the second one you get the variable value that is set.

If you run from the command line (mvn test) both variables get expanded correctly
Comment 1 Guillermo López CLA 2011-02-24 07:22:17 EST
Created attachment 189689 [details]
sample project

This is the sample maven project. It's worth to say that this behavior is the same on other use cases (i.e using the cargo plugin)
Comment 2 Igor Fedorenko CLA 2011-04-12 15:55:14 EDT
I was not able to reproduce the problem on Ubuntu 10.10 using recent m2e 0.13 build. Do note that I explicitly did "export CUSTOM_VAR=..." from the same shell I started m2e from.
Comment 3 Martin Bartlett CLA 2011-10-20 11:46:26 EDT
<systemPath>${env.JAVA_HOME}/lib/jconsole.jar</systemPath> is exhibiting this exact behaviour on 

Helios Service Release 2
Build id: 20110218-0911

Ubuntu 10.10 64bit

org.maven.ide.edlipse.feature 0.10.2.201062
Comment 4 Denis Roy CLA 2021-04-19 13:25:03 EDT
Moved to https://github.com/eclipse-m2e/m2e-core/issues/