title: Set `defaultCharset` from `pom.xml`
body: <p>This is a follow up to <a href="https://stackoverflow.com/q/10386509/850781">set <code>file.encoding</code> from <code>pom.xml</code></a>.
  I need to make sure that <strong>Charset.defaultCharset()</strong> returns <strong>UTF-8</strong>.
  When I run </p>
  
  <pre><code>JAVA_TOOL_OPTIONS='-Dfile.encoding=UTF-8' mvn clean compile test package
  </code></pre>
  
  <p>I get that.  However, I do not have any control about how <code>mvn</code> is invoked, so I need to put something into <code>pom.xml</code> which would set the default charset to <code>utf-8</code>.
  Which <code>systemPropertyVariables</code> do I set?</p>
  
  <p>EDIT:
  I do have</p>
  
  <pre><code>&lt;properties&gt;
      &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
  &lt;/properties&gt;
  </code></pre>
  
  <p>and</p>
  
  <pre><code>&lt;configuration&gt;
    &lt;systemPropertyVariables&gt;
      &lt;file.encoding&gt;${project.build.sourceEncoding}&lt;/file.encoding&gt;
      &lt;charset&gt;${project.build.sourceEncoding}&lt;/charset&gt;
    &lt;/systemPropertyVariables&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>they do not help.  <code>defaultCharset</code> is still <code>US-ASCII</code>.</p>