How to get the module name from pom in java

Viewed 3026

I have a requirement in which based on module names, I need to do some operations. How to fetch the modules name from pom.xml in a java class. My pom.xml has like below :

<artifactId>test</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>


<modules>
        <module>name1</module>
        <module>name2</module>    
</modules>

I saw we can get artifactId 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.

version=${project.version}
artifactId=${project.artifactId}

Thanks

1 Answers
Related