title: Global MAVEN_OPTS does not seem to work with Jenkins
body: <p>I installed Jenkins 1.512 on CentOS (info as follows) and configured it to work with <strong>apache-maven-3.0.4</strong>.</p>
  
  <pre><code>Linux server.masstermmind.com 2.6.32-358.2.1.el6.x86_64 #1 SMP Tue Mar 12 14:18:09 CDT 2013 x86_64 x86_64 x86_64 GNU/Linux
  </code></pre>
  
  <p>I was actually trying to solve a problem where Maven complained about missing vaule of <code>jbossHome</code> parameter in the <code>pom.xml</code> file. So, I decided to debug Maven by putting the <code>-X</code> option in Jenkins <code>MAVEN_OPTS</code>. But it complained that I put in an incorrect Java argument:</p>
  
  <pre><code>The -X options are non-standard and subject to change without notice.
  </code></pre>
  
  <p>It turned out Jenkins thinks I put in an argument for Java. Later I found out the command generated by Jenkins was like the following:</p>
  
  <blockquote>
    <p>/usr/java/jdk1.7.0_17/bin/java <strong>-X</strong> -cp /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-agent-1.2.jar:/usr/share/apache-maven-3.0.5/boot/plexus-classworlds-2.4.jar org.jvnet.hudson.maven3.agent.Maven3Main /usr/share/apache-maven-3.0.5 /var/cache/jenkins/war/WEB-INF/lib/remoting-2.23.jar /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-1.2.jar 35460</p>
  </blockquote>
  
  <p>But what I found out from running <code>mvn</code>, it generated the following Java line, and the "-X" was placed at the end, correctly.</p>
  
  <blockquote>
    <p>/usr/java/jdk1.7.0_17/bin/java  -cp /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-agent-1.2.jar:/usr/share/apache-maven-3.0.5/boot/plexus-classworlds-2.4.jar org.jvnet.hudson.maven3.agent.Maven3Main /usr/share/apache-maven-3.0.5 /var/cache/jenkins/war/WEB-INF/lib/remoting-2.23.jar /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-1.2.jar <strong>-X</strong></p>
  </blockquote>
  
  <p>Could you share an approach how I can fix this or it is a Jenkins bug?</p>