title: Passing -D Java Options to mvn install in IntelliJ has no effect, passing Properties does - why?
body: <p>The <code>java</code> <code>man</code> page specifies </p>
  
  <pre><code>java [options] classname [args]
  </code></pre>
  
  <p>and <a href="https://docs.oracle.com/javase/8/docs/technotes/tools/unix/java.html" rel="nofollow noreferrer">details</a> </p>
  
  <blockquote>
    <p><strong>Standard Options</strong></p>
    
    <p>...</p>
    
    <p><strong>-D<em>property=value</em></strong> Sets a system property value. The property variable is a string with no spaces that represents the name of the property.
    The value variable is a string that represents the value of the
    property. If value is a string with spaces, then enclose it in
    quotation marks (for example <code>-Dfoo="foo bar"</code>).</p>
  </blockquote>
  
  <p>When I configure Maven in IntelliJ (Preferences > Build, Execution, Deployment > Build Tools > Maven > Runner), it allows me to set</p>
  
  <ul>
  <li>VM Options</li>
  <li>Environment Variables</li>
  <li>Properties</li>
  </ul>
  
  <p>When adding Properties, a dialogue pops up that allows me to "<em>Add Maven Property</em>".</p>
  
  <p>Judging from the <code>java</code> <code>man</code> page excerpt above, I would expect IntelliJ to turn the Properties key-value-pairs into <code>-Dkey=value</code> options.</p>
  
  <p>However, when maven gets run by IntelliJ, the first line of console output basically boils down to this:</p>
  
  <pre><code>/path/to/java
   -Dvm=option
   -classpath /path/to/apache-maven/boot/plexus-classworlds-2.5.2.jar
  org.codehaus.classworlds.Launcher
   -Dproperty=value
  install -P selectedProfiles
  </code></pre>
  
  <p>i.e. <code>java options classname someMoreOptionsAndTheArguments</code>.</p>
  
  <p>From that it seems that IntelliJ adds the <strong><em>Properties</em></strong> as <em>arguments</em> to the class (huh?), whereas the <strong><em>VM options</em></strong> are passed in as <em>options</em> (as expected).</p>
  
  <p>Now, in a unit test, I added</p>
  
  <pre><code>Properties properties = System.getProperties();
  properties.list(System.out);
  </code></pre>
  
  <p>and it only prints <code>property=value</code> but not <code>jvm=option</code>.</p>
  
  <p><strong>Why</strong> are VM Options (set in IntelliJ) not passed through to my tests, and why do the Properties (that seem to be passed in as arguments by IntelliJ) make it all the way to the unit test level? And why is it called "Maven Property", not System Property, in IntelliJ's Add dialogue? (Is that a clue to the cause of the observed behaviour?)</p>