title: Maven: Enforce all subdirectories are modules in aggregator pom
body: <p>We have <a href="https://github.com/vespa-engine/sample-apps" rel="nofollow noreferrer">git repository</a> with a set of sample applications. Each sample app has its own subdirectory and its own pom.xml, but no common parent pom. The root level has an <a href="https://github.com/vespa-engine/sample-apps/blob/master/pom.xml" rel="nofollow noreferrer">aggregator pom</a> that <em>should</em> list all the sample apps. </p>
  
  <pre><code>+- sample-apps
  |  +- sample-app-A
  |  +- sample-app-B
  |  +- etc...
  </code></pre>
  
  <p>Because each sample app has a dependency to our core product, and we want the sample apps to use our latest version, we run the <code>maven-versions-plugin</code> from the root level to keep all apps up-to-date. However, developers that add new sample apps (subfolders) forget to add them to the aggregator pom. Hence, those sample apps will become stale over time.</p>
  
  <p>Is there a way for maven to enforce that all subdirectories are listed as modules in the aggregator pom? We could write a <a href="http://maven.apache.org/enforcer/enforcer-api/writing-a-custom-rule.html" rel="nofollow noreferrer">custom enforcer rule</a> for the <code>maven-enforcer-plugin</code>, but want to check for better alternatives first.</p>
  
  <p>We do not want the sample apps to have a parent pom from our side, as the customer should be able to modify the sample app and inherit from his own parent.</p>