You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Will Hoover <ja...@gmail.com> on 2012/12/20 20:40:37 UTC

Maven Set PATH Environment Variable

Anyone know of a way to set environment variables that will be used while
Maven is running?

 

I've tried the following, but it doesn't get picked up by subsequent plug-in
executions:

 

<plugin>

                <groupId>org.codehaus.mojo</groupId>

                <artifactId>exec-maven-plugin</artifactId>

                <executions>

                                <execution>

                                                <id>setenv</id>

 
<phase>process-classes</phase>

                                                <goals>

 
<goal>exec</goal>

                                                </goals>

                                                <configuration>

 
<includeProjectDependencies>false</includeProjectDependencies>

 
<executable>SETX</executable>

                                                                <arguments>

 
<argument>Path</argument>

 
<argument>${env.PATH};/some/other/path</argument>

 
<argument>/M</argument>

                                                                </arguments>

 
<environmentVariables>

 
<key>PATH</key>

 
<value>${env.PATH};/some/other/path</value>

 
</environmentVariables>

                                                </configuration>

                                </execution>

                </executions>

</plugin>