[ https://jira.codehaus.org/browse/MNG-4559?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=302917#comment-302917 ]
Dale Wijnand commented on MNG-4559: ----------------------------------- This definitely needs to be tested, but I saw something about how this should be handled in an old Tomcat mailing list email, and I just had a problem with this when trying to add a -javaagent. Here's my 3-second solution, which might or might not work for you, test it: add "eval" in front of exec in the script, so it becomes: eval exec "$JAVACMD" \ $MAVEN_OPTS \ -classpath "${M2_HOME}"/boot/plexus-classworlds-*.jar \ "-Dclassworlds.conf=${M2_HOME}/bin/m2.conf" \ "-Dmaven.home=${M2_HOME}" \ ${CLASSWORLDS_LAUNCHER} "$@" Details: Apache Maven 3.0.4 (r1232337; 2012-01-17 09:44:56+0100) Maven home: /usr/local/Cellar/maven/current/libexec Java version: 1.6.0_33, vendor: Apple Inc. Java home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home Default locale: en_GB, platform encoding: MacRoman OS name: "mac os x", version: "10.7.4", arch: "x86_64", family: "mac" > MAVEN_OPTS are incorrectly resolved in Unix > ------------------------------------------- > > Key: MNG-4559 > URL: https://jira.codehaus.org/browse/MNG-4559 > Project: Maven 2 & 3 > Issue Type: Bug > Affects Versions: 2.2.1 > Environment: OS: Linux, 2.6.32-11-generic, amd64. > Java: 1.6.0_17 > Reporter: Maxim Podkolzine > Fix For: Issues to be reviewed for 3.x > > > I'm trying to pass a quoted parameter through MAVEN_OPTS, e.g. > MAVEN_OPTS="-Dfoo='bar baz'" > As a result the quotes are not resolved, causing Java failure: > Exception in thread "main" java.lang.NoClassDefFoundError: baz' > ... > I couldn't figure out a way to make it work. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira