title: How to use POMs as a dependency in Maven?
body: <p>Is there a way to add a <code>pom</code> type dependency to my POM and get all its modules?</p>
  
  <p><a href="https://java.net/projects/javamail/pages/Home" rel="noreferrer">JavaMail</a> is a good example.  Maven Central Repo has a parent POM called: <a href="http://search.maven.org/#artifactdetails%7Ccom.sun.mail%7Call%7C1.5.0%7Cpom" rel="noreferrer">com.sun.mail:all:1.5.0</a> with modules: mail, mailapi, mailapijar, smtp, imap, gimap, pop3, and dsn.</p>
  
  <p>However, the "all" artefact only has a single file: <code>pom.xml</code>  Is there a way to add this "all" artefact as a dependency to my POM and get all its modules?  I am 90% sure this is not the right way to use dependencies in Maven, but I want to hear it from an expert on The Stack.</p>
  
  <p>Ideas:</p>
  
  <ul>
  <li><code>&lt;dependencies&gt;&lt;dependency&gt;...&lt;type&gt;pom&lt;/type&gt;&lt;/dependency&gt;&lt;/dependencies&gt;</code></li>
  <li><code>&lt;dependencyManagement&gt;&lt;dependencies&gt;&lt;dependency&gt;...&lt;type&gt;pom&lt;/type&gt;&lt;scope&gt;import&lt;/scope&gt;&lt;/dependency&gt;&lt;/dependencies&gt;&lt;/dependencyManagement&gt;</code></li>
  </ul>
  
  <p>Related: <a href="https://stackoverflow.com/questions/12868537/netbeans-maven-dependencies-of-type-pom">Netbeans: maven dependencies of type pom</a></p>