title: Error sending email in Java 11 with javaMail - java.lang.module.ResolutionException:
body: <p>I'm using JavaMail API to send email with Java 11 using maven when I send an email I get the following exception:</p>
  
  <pre class="lang-java prettyprint-override"><code>Error occurred during initialization of boot layer
  java.lang.module.ResolutionException: Modules javax.mail.api and javax.mail export package javax.mail.search to module java.persistence
  </code></pre>
  
  <p>dependencies.</p>
  
  <pre class="lang-xml prettyprint-override"><code> &lt;dependency&gt;
              &lt;groupId&gt;javax.mail&lt;/groupId&gt;
              &lt;artifactId&gt;javax.mail-api&lt;/artifactId&gt;
              &lt;version&gt;1.5.5&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.sun.mail&lt;/groupId&gt;
              &lt;artifactId&gt;javax.mail&lt;/artifactId&gt;
              &lt;version&gt;1.5.5&lt;/version&gt;
          &lt;/dependency&gt;
  </code></pre>
  
  <p>module-info.java</p>
  
  <pre class="lang-java prettyprint-override"><code>  //persistence
      requires java.persistence;
      requires java.sql;
      requires com.fasterxml.classmate;
      requires java.xml.bind;
      requires org.hibernate.orm.core;
  
      requires java.logging;
      requires java.json;
      requires jdk.xml.dom;
      requires net.bytebuddy;
  
      requires java.activation;
  
      //mail
      requires javax.mail;
  </code></pre>
  
  <p>there seems to be a conflict with the hibernation-core, does anyone have any idea how to resolve?</p>