title: Maven build fails while using JCE with " The jurisdiction policy files are not signed by a trusted signer!"
body: <p>I am using the JCE to encrypt and decrypt in my project. I have installed the necessary java security jars under $JAVA_HOME/jre/lib/security. Also in my development environment in eclipse I am pointing to the correct jre. Everything works fine in eclipse. But when I build the project with maven , it fails with the following exeption</p>
  
  <pre><code> The jurisdiction policy files are not signed by a trusted signer!
  </code></pre>
  
  <p>Things tried so far.</p>
  
  <p>Tried a hack by initializing the following block of code before anything else </p>
  
  <pre><code> try {
      Field field = Class.forName("javax.crypto.JceSecurity").getDeclaredField("isRestricted");
      field.setAccessible(true);
      field.set(null, java.lang.Boolean.FALSE);
  } catch (ClassNotFoundException | NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException ex) {
      ex.printStackTrace(System.err);
  }
  </code></pre>
  
  <p>Also tried changing the pom.xml by adding the following plugin </p>
  
  <pre><code>&lt;plugins&gt;
  &lt;plugin&gt;
    &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
   &lt;artifactId&gt;maven-enforcer-plugin&lt;/artifactId&gt;
   &lt;version&gt;1.1.1&lt;/version&gt;
   &lt;executions&gt;
       &lt;execution&gt;
           &lt;id&gt;enforce&lt;/id&gt;
              &lt;configuration&gt;
                  &lt;rules&gt;
                    &lt;evaluateBeanshell&gt;
                       &lt;condition&gt;javax.crypto.Cipher.getMaxAllowedKeyLength("AES") &gt; 128&lt;/condition&gt;
                    &lt;/evaluateBeanshell&gt;
               &lt;/rules&gt;
           &lt;/configuration&gt;
           &lt;goals&gt;
               &lt;goal&gt;enforce&lt;/goal&gt;
           &lt;/goals&gt;
        &lt;/execution&gt;
   &lt;/executions&gt;
  &lt;/plugin&gt;
  </code></pre>
  
  <p>I have confirmed that the version of the policy jars matches the Java version on my machine.  Is there a way to configure maven to use these jars?  (Without having to use another library like Bouncy Castle) Thanks.</p>