title: How to get the module name from pom in java
body: <p>I have a requirement in which based on module names, I need to do some operations.
  How to fetch the modules name from <code>pom.xml</code> in a java class. 
  My <code>pom.xml</code> has like below :</p>
  
  <pre><code>&lt;artifactId&gt;test&lt;/artifactId&gt;
  &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
  &lt;packaging&gt;pom&lt;/packaging&gt;
  
  
  &lt;modules&gt;
          &lt;module&gt;name1&lt;/module&gt;
          &lt;module&gt;name2&lt;/module&gt;    
  &lt;/modules&gt;
  </code></pre>
  
  <p>I saw we can get <code>artifactId</code> and version as below from a property file. Here module is a list how to get the modules names from the list. Any help would be appreciated.</p>
  
  <pre><code>version=${project.version}
  artifactId=${project.artifactId}
  </code></pre>
  
  <p>Thanks</p>