trange encoding of environment variables when using exec plugin
---------------------------------------------------------------

                 Key: MEXEC-75
                 URL: http://jira.codehaus.org/browse/MEXEC-75
             Project: Maven 2.x Exec Plugin
          Issue Type: Bug
          Components: exec
    Affects Versions: 1.1.1
         Environment: Windows XP, czech mutation
            Reporter: Dusan Zatkovsky
            Priority: Critical


At fist, you must use non-us windows xp ( I have reproduced this on Windows XP 
Professional CZECH mutation ).

Create simple maven project with one class ( for example test.App ).

Write following code:

public class App {

    public static void main(String[] args) throws IOException {

        String s = args[0];
        FileWriter w = new FileWriter(new File("c:\\output.txt"), true);

        // get env variable
        String appData = System.getenv("APPDATA");

        // write env variable to file and write if directory where that 
variable points to exists
        w.write(s + " : " + appData + " : " + new File(appData).exists() + 
"\n");  

        w.close();
        
    }

Then run this app with exec:exec and directly by following commands:

mvn install
mvn exec:exec -Dexec.executable=java -Dexec.args="-classpath %classpath 
test.App maven"
java -cp target\mavenExecEncodingBug-1.0-SNAPSHOT.jar test.App jar


We are expecting result like:
maven : C:\Documents and Settings\admin\Data aplikací : true
jar : C:\Documents and Settings\admin\Data aplikací : true


But it is:
maven : C:\Documents and Settings\admin\Data aplikacˇ : false
jar : C:\Documents and Settings\admin\Data aplikací : true


This is a big problem for me, because my applications looks into different 
folders when running from IDE and in production.
See also https://netbeans.org/bugzilla/show_bug.cgi?id=172265 for more 
reference.

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