[ 
http://jira.codehaus.org/browse/MEXEC-39?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_126649
 ] 

Phil Porter commented on MEXEC-39:
----------------------------------


Hi,

We would find this very useful too.  The following seems to work.  Have kept it 
consistent with the surefire plugin.

Regards,

Phil

Index: ExecMojo.java
===================================================================
--- ExecMojo.java       (revision 6415)
+++ ExecMojo.java       (working copy)
@@ -32,6 +32,8 @@
 import java.util.Collection;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Map;
+import java.util.HashMap;
 import java.util.StringTokenizer;

 /**
@@ -75,6 +77,11 @@
      * @required
      */
     private File basedir;
+
+    /**
+     * @parameter
+     */
+     private Map environmentVariables = new HashMap();

     /**
      * if exec.args expression is used when invokign the exec:exec goal,
@@ -188,6 +195,17 @@

         commandLine.setWorkingDirectory( workingDirectory.getAbsolutePath() );

+        if ( environmentVariables != null )
+        {
+            Iterator iter = environmentVariables.keySet().iterator();
+            while ( iter.hasNext() )
+            {
+                String key = (String) iter.next();
+                String value = (String) environmentVariables.get( key );
+                commandLine.addEnvironment( key, value );
+            }
+        }
+
         // FIXME what about redirecting the output to getLog() ??
         // what about consuming the input just to be on the safe side ?
         // what about allowing parametrization of the class name that acts as 
consumer?


> Support configuring environment variables
> -----------------------------------------
>
>                 Key: MEXEC-39
>                 URL: http://jira.codehaus.org/browse/MEXEC-39
>             Project: Maven 2.x Exec Plugin
>          Issue Type: New Feature
>            Reporter: Trygve Laugstol
>


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to