This is not easy, there are two parts you need to implement.
- get the snippets from the other module
- assemble the xml file using the include
for 1. you can use the dependency:unpack mojo:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unpack</id>
<phase>initialize</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/snippets</outputDirectory>
<includes>snippets/*.xml</includes>
<artifactItems>
<artifactItem>
<groupId>your.app</groupId>
<artifactId>module1</artifactId>
<version>${project.version}</version>
<type>jar</type>
</artifactItem>
<artifactItem>
<groupId>your.app</groupId>
<artifactId>module2</artifactId>
<version>${project.version}</version>
<type>jar</type>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
Now you have copied all snippets from module1.jar/snippets and module2.jar/snippets to target/snippets (this was the easier part).
For 2. you need to pick a template engine and create a main class to assemble your template with it, probably using the exec:java mojo something like this:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.1</version>
<executions>
<execution>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>com.yourcompany.YourTemplateParser</mainClass>
<arguments>
<argument>path/to/your/template</argument>
<argument>path/to/the/snippets/folder</argument>
<argument>target/path</argument>
</arguments>
</configuration>
</plugin>
(Personally, I tend to use GMaven instead of exec:java, as you can write inline groovy scripts without creating custom java classes)