title: JDK9 Automatic Modules and "Split Packages" Dependencies
body: <p>I am converting a java project to use modules. One of my modules depends on <code>hamcrest</code> library, and it needs both of the jar files <code>hamcrest.core</code> and <code>hamcrest.library</code>. These two jar files both have <code>org.hamcrest</code> package. So when my module wants to treat these two jars as automatic modules, it fails because two modules in a module-path cannot have packages with same name. I searched a lot and found some related stuff on stackoverflow. It seems that I have two reasonable options if I do not want to rebuild those dependencies:</p>
  
  <ol>
  <li>Merge the two jars into one jar using my build automation tool (which is maven).</li>
  <li>Somehow tell java compiler that these two jars should be treated as a single automatic module.</li>
  </ol>
  
  <p>So here are my questions:</p>
  
  <ul>
  <li>Is any of these two options possible? If yes, how?</li>
  <li>Is there any better option?</li>
  </ul>
  
  <p>Thanks in advance</p>