title: Eclipse Certification Maven
body: <p>I have a <code>Maven repository</code> that is in my company server so I have to use a certificate to connect.</p>
  
  <p>i had to modify my <code>mvn</code> command and add these lines:</p>
  
  <pre><code>export MAVEN_OPTS=-Djavax.net.ssl.trustStore=/maven/bin/maven.jks
  export MAVEN_OPTS=$MAVEN_OPTS -Djavax.net.ssl.trustStorePassword=123456
  export MAVEN_OPTS=$MAVEN_OPTS -Djavax.net.ssl.trustStoreType=JKS
  export MAVEN_OPTS=$MAVEN_OPTS -Dmaven.wagon.http.ssl.insecure=true
  export MAVEN_OPTS=$MAVEN_OPTS -Dmaven.wagon.http.ssl.allowall=true
  </code></pre>
  
  <p>After that I added this certificate to my <code>cacerts</code> file here:</p>
  
  <pre><code>/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre/lib/security/cacerts
  </code></pre>
  
  <p>I also modify my installed Maven settings.xml file to this:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8" standalone="no"?&gt;
  &lt;settings xmlns="http://maven.apache.org/SETTINGS/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd"&gt;
      &lt;mirrors&gt;
          &lt;mirror&gt;
              &lt;id&gt;companyrepo.group&lt;/id&gt;
              &lt;name&gt;companyrepo.group&lt;/name&gt;
              &lt;url&gt;https://companyrepo.intra/companyrepo.group&lt;/url&gt;
              &lt;mirrorOf&gt;*&lt;/mirrorOf&gt;
          &lt;/mirror&gt;
      &lt;/mirrors&gt;
      &lt;profiles&gt;
          &lt;profile&gt;
              &lt;activation&gt;
                  &lt;activeByDefault&gt;true&lt;/activeByDefault&gt;
              &lt;/activation&gt;
              &lt;repositories&gt;
                  &lt;repository&gt;
                      &lt;id&gt;companyrepo.group&lt;/id&gt;
                      &lt;url&gt;https://companyrepo.intra/companyrepo.group&lt;/url&gt;
                      &lt;releases&gt;
                          &lt;enabled&gt;true&lt;/enabled&gt;
                      &lt;/releases&gt;
                      &lt;snapshots&gt;
                          &lt;enabled&gt;true&lt;/enabled&gt;                                                                                             
                      &lt;/snapshots&gt;
                  &lt;/repository&gt;
              &lt;/repositories&gt;
          &lt;/profile&gt;
      &lt;/profiles&gt;
      &lt;activeProfiles&gt;
      &lt;/activeProfiles&gt;
       &lt;proxies&gt;
      &lt;/proxies&gt;
      &lt;servers&gt;
          &lt;server&gt;
              &lt;id&gt;companyrepo.group&lt;/id&gt;
          &lt;/server&gt;
      &lt;/servers&gt;
  &lt;/settings&gt;
  </code></pre>
  
  <p>And also set my Eclipse to use this settings file.</p>
  
  <p>If I try to connect this repo from my terminal I can access, for example if I run <code>mvn package</code> command I can connect to this repo.</p>
  
  <p>After that I set my Eclipse/Preferences/Maven/Installation to not use the build in default <code>Maven</code> but if I open a project that use this company repository i got this error message:</p>
  
  <pre><code>Failure to transfer org.apache.maven.plugins:maven-resources-plugin:pom:2.4.3 from https://companyrepo.intra/companyrepo.group was cached in the local repository, resolution will not be reattempted until 
   the update interval of companyrepo.group has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.4.3 from/to companyrepo.group (https://companyrepo.intra/companyrepo.group): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to 
   requested target
  </code></pre>
  
  <p>Where should I set this <code>jks</code> to make <code>Eclipse</code> see the repository? Thank you! </p>