I am using the Maven EAR plugin to create my ear files for a new project. I noticed that in the plugin documentation you can specify exception instructions for modules. For example, the configuration of my plugin is as follows:
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<version>2.4.1</version>
<configuration>
<jboss>
<version>5</version>
</jboss>
<modules>
<jarModule>
<groupId>com.kewill.kdm</groupId>
<artifactId>templatecontroller</artifactId>
<bundleFileName>templatecontroller.jar</bundleFileName>
<includeInApplicationXml>true</includeInApplicationXml>
</jarModule>
<jarModule>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<excluded>true</excluded>
</jarModule>
<jarModule>
<groupId>antlr</groupId>
<artifactId>antlr</artifactId>
<excluded>true</excluded>
</jarModule>
... declare multiple excludes
<security>
<security-role id="SecurityRole_1234">
<role-name>admin</role-name>
</security-role>
</security>
</configuration>
</plugin>
</plugins>
This approach is absolutely good with small projects in which you say 4-5 modules for exclusion. However, in my project I have 30+, and we just started the project, as it expands, it is likely to grow.
Also, by explicitly declaring exclude statements for each module, is it possible to use wildcards or exclude all maven dependency flags to include only those modules that I declare and exclude everything else? Does anyone know of a more elegant solution?