title: Is there a generic way to set -D arguments from within a pom.xml?
body: <p><strong>tl;dr:</strong> So, is there a way to move the definition of a <code>-D</code> system property and to internalise it within the <code>pom.xml</code> file?</p>
  
  <hr>
  
  <p>We are currently passing <code>-Djavax.xml.accessExternalSchema=all</code> from the command line as <code>mvn clean install -Djavax.xml.accessExternalSchema=all</code> to enable my build to work. I cannot pass the option in the plug-in (<a href="http://www.mojohaus.org/jaxb2-maven-plugin/Documentation/v2.2/" rel="nofollow noreferrer">jaxb2-maven-plugin</a> 1.6) since the version we are using doesn't support this and the version that does requires completely changing the configuration and we won't get approval for that.</p>
  
  <p>Trying to set the value of using a tag within <code>&lt;properties&gt;</code> like <a href="https://stackoverflow.com/questions/899274/setting-default-values-for-custom-maven-2-properties">suggested elsewhere</a> by adding under the <code>&lt;project&gt;</code> tag:</p>
  
  <pre><code>&lt;properties&gt;
      &lt;javax.xml.accessExternalSchema&gt;all&lt;/javax.xml.accessExternalSchema&gt;
  &lt;/properties&gt;
  </code></pre>
  
  <p>but I still get an error (reproduced below) whereas with passing it by the command-line does not.</p>
  
  <pre><code>Caused by: org.xml.sax.SAXParseException; 
  systemId: jar:file:/e:/apache/maven/.m2/repository/com/sun/xml/bind/jaxb-xjc/2.2.7/jaxb-xjc-2.2.7.jar!/com/sun/tools/xjc/reader/xmlschema/bindinfo/binding.xsd; 
  lineNumber: 52; columnNumber: 88; schema_reference: 
  Failed to read schema document 'xjc.xsd', because 'file' access is not allowed due to restriction set by the accessExternalSchema property.
  </code></pre>