title: How to give VM parameter to JBoss from command line?
body: <p>I am configuring JaCoCo code coverage tool to work with JBoss. This includes adding the JaCoCo agent as a VM parameter to JBoss. I have got it to work by adding the parameter to JAVA_OPTS straight in the JBoss run.config scripts, but because this needs to be quite dynamic, I would need to give the VM parameter at command line (executed by Jenkins). How do I do this? I know system properties can be given using the "D" before the key.</p>
  
  <p>Also, is it possible to add the agent to the run.config file, and then pass a custom property to it? So I would add this to the run.config file:</p>
  
  <pre><code>JAVA_OPTS="$JAVA_OPTS -javaagent:/home/installations/jacoco/jacocoagent.jar=destfile=$path/jacoco.exec"
  </code></pre>
  
  <p>And then I would start JBoss like this:</p>
  
  <pre><code>./run.sh -Dpath=/home/workspace/jacoco
  </code></pre>
  
  <p>Does something like this work?</p>