Reputation: 9924
I have a maven project in which I would like to unpack all the child modules of a mutli module project. Does anyone know if the best way to approach this? There are over 100 modules in this project and I'm trying to avoid having to copy all this information somewhere else.
Upvotes: 1
Views: 794
Reputation: 298818
First you will need to create a pom.xml file that has all the projects as dependencies.
Then, in this project, you can use dependency:unpack-dependencies
to unpack the projects:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unpack-projects</id>
<phase>generate-sources</phase>
<goals>
<goal>unpack-dependencies</goal>
</goals>
<configuration>
<includeGroupIds>com.basegroupId*</includeGroupIds>
</configuration>
</execution>
</executions>
</plugin>
(Set includeGroupIds to a pattern that matches all submodule groupIds)
Now you just have to call
mvn generate-sources
(or any other phase you configure in the execution)
Upvotes: 1