You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "John Mazzitelli (JIRA)" <ji...@codehaus.org> on 2007/03/21 17:05:34 UTC

[jira] Commented: (SUREFIRE-297) argLine has changed behavior from 2.2 to 2.3.

    [ http://jira.codehaus.org/browse/SUREFIRE-297?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_90716 ] 

John Mazzitelli commented on SUREFIRE-297:
------------------------------------------

I found something similar.  It has to do with spaces in the property value.  I think the surefile plugin is trying to be "too smart" but breaking things.

I have the following in my pom surefile configuration:

      <plugin>        
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <argLine>-Djava.library.path=${settings.localRepository}/foo/bar/1.0</argLine>
        </configuration>
      </plugin>

When I run "mvn -X test", here's what the beginning of the VM command line looks like:

   Forking command line: C:\mazz\java\jdk1.5.0\jre\bin\java -Djava.library.path=C:\Documents and Settings\mazz\.m2\repository/foo/bar/1.0 -classpath ...

which looks correct but results in the error:

   java.lang.NoClassDefFoundError: and
   Exception in thread "main"

because of the spaces - the -D argument needs to be fully wrapped in quotes.

But if I try to wrap the argLine value in quotes:

          <argLine>"-Djava.library.path=${settings.localRepository}/foo/bar/1.0"</argLine>

the command line is broken still.  I just want the plugin to pass this as-is, but for some reason, it wants to wrap each token (separated by the spaces) in single quotes!  It is trying to be smart about things, but it ends up doing it wrong:

   Forking command line: C:\mazz\java\jdk1.5.0\jre\bin\java '"-Djava.library.path=C:\Documents' and 'Settings\mazz\.m2\repository/foo/bar/1.0"' -classpath...

I think if argLine begins and ends with double-quotes, the plugin should pass that entire string as-is - don't try to parse it and wrap around spaces - let the pom writer provide the quotes around the space-separated tokens as appropriate.

> argLine has changed behavior from 2.2 to 2.3.
> ---------------------------------------------
>
>                 Key: SUREFIRE-297
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-297
>             Project: Maven Surefire
>          Issue Type: Bug
>    Affects Versions: 2.3
>         Environment: Windows XP
>            Reporter: Bård Dybwad Kristensen
>            Priority: Critical
>             Fix For: 2.3.1
>
>
> Hi
> I have used the following configuration for the surefire plugin version 2.2:
> 				<configuration>
> 					<argLine>-verbose -javaagent:D:\.m2\repository\jmockit\jmockit\0.83\jmockit-0.83.jar</argLine>
> 			        </configuration>
> It works (not really, but that is another issue). But when I downloaded version 2.3, this stopped working. The -verbose argument is still forwarded to the java process, but the -javaagent is not forwarded. If I switch back to the 2.2 version of the plug in, everything is fine. Any ideas?
> regards,
> bdk

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