Multi-module Maven build

Posted by Don on Stack Overflow See other posts from Stack Overflow or by Don
Published on 2010-05-12T14:52:36Z Indexed on 2010/05/12 14:54 UTC
Read the original article Hit count: 243

Filed under:
|

Hi,

My project has a fairly deep graph of Maven modules. The root POM has the following plugin configured

 <plugins>    
   <plugin>
     <groupId>org.jvnet</groupId>
     <artifactId>animal-sniffer</artifactId>
     <version>1.2</version>
     <configuration>
       <signature>
         <groupId>org.jvnet.animal-sniffer</groupId>
         <artifactId>java1.4</artifactId>
         <version>1.0</version>
       </signature>
     </configuration>
   </plugin>
 </plugins>    

If I invoke this target from the command line in the root directory via:

mvn animal-sniffer:check

Then it works fine as long as the current module extends (either directly or indirectly) from the root POM. However there are many children (or grandchildren) of the root module, which do not inherit from that module's POM. In this case, the goal fails because it cannot find the necessary configuration

[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] One or more required plugin parameters are invalid/missing for 'animal-sniffer:check'

[0] Inside the definition for plugin 'animal-sniffer' specify the following:

<configuration>
  ...
  <signature>VALUE</signature>
</configuration>.

When configuring this plugin in the root module, is there any way to exclude a list of sub-modules either by name, or by packaging type?

Thanks, Donal

© Stack Overflow or respective owner

Related posts about maven-2

Related posts about java