GMaven

Joint Compilation Broken for Multi Module Projects

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Not A Bug
  • Affects Version/s: 1.2
  • Fix Version/s: None
  • Component/s: stub generation
  • Labels:
    None
  • Number of attachments :
    0

Description

From mailing list discussion
http://old.nabble.com/GMaven-and-Groovy-1.7-td27378212.html#a27408942

The plugin is not inherited by sub projects. (previous version were inherited)

example in parent-module .pom you have a the plugin configured as

<build>
   <plugins>
     <plugin>
       <groupId>org.codehaus.gmaven</groupId>
       <artifactId>gmaven-plugin</artifactId>
       <version>1.2</version>
       <configuration>
         <providerSelection>1.7</providerSelection>
       </configuration>
       <executions>
         <execution>
           <goals>
             <goal>compile</goal>
             <goal>testCompile</goal>
             <!-- if you want joint compilation, add stub generation goals
here -->
           </goals>
         </execution>
       </executions>
       <dependencies>
         <dependency>
           <groupId>org.codehaus.gmaven.runtime</groupId>
           <artifactId>gmaven-runtime-1.7</artifactId>
           <version>1.2</version>
           <exclusions>
             <exclusion>
               <groupId>org.codehaus.groovy</groupId>
               <artifactId>groovy-all</artifactId>
             </exclusion>
           </exclusions>
         </dependency>
         <dependency>
           <groupId>org.codehaus.groovy</groupId>
           <artifactId>groovy-all</artifactId>
           <version>1.7.0</version>
         </dependency>
       </dependencies>
     </plugin>
   </plugins>
 </build>

 <dependencies>
   <dependency>
     <groupId>org.codehaus.groovy</groupId>
     <artifactId>groovy-all</artifactId>
     <version>1.7.0</version>
   </dependency>
 </dependencies>

You should not be required to add the build plugin section to each sub project/module.

Activity

Hide
Peter Niederwieser added a comment -

I don't think this is a bug. To inherit your plugin configuration, you can either use <inherited>true</inherited>, or use <pluginManagement> instead of <plugins>. (In the latter case you still need to mention the plugin in every POM, but without all the details).

Show
Peter Niederwieser added a comment - I don't think this is a bug. To inherit your plugin configuration, you can either use <inherited>true</inherited>, or use <pluginManagement> instead of <plugins>. (In the latter case you still need to mention the plugin in every POM, but without all the details).
Hide
Ben Tilford added a comment -

Adding the <inherited>true</inherited> does work but I don't have to do this with any other plugin I use. They all default to true.

I'm not sure what the "maven recommended default" is for sure though.

Show
Ben Tilford added a comment - Adding the <inherited>true</inherited> does work but I don't have to do this with any other plugin I use. They all default to true. I'm not sure what the "maven recommended default" is for sure though.
Hide
Peter Niederwieser added a comment -

AFAIK it's not possible for a plugin to default to true for <inherited>. I suppose the plugins you are referring to run once per project instead of once per module, in which case they don't need to be inherited in order to reach all modules.

Show
Peter Niederwieser added a comment - AFAIK it's not possible for a plugin to default to true for <inherited>. I suppose the plugins you are referring to run once per project instead of once per module, in which case they don't need to be inherited in order to reach all modules.
Hide
Ben Tilford added a comment - - edited

Just noticed that even with <inherited>true</inherited> being set in plugin management of the root pom and having the plugin in the root pom's build section that groovy tests do not run. The only way to get them to run is to copy the entire <plugin>...</plugin> (configuration and everything) into each sub project's <build> section.

Ignore this issue. I found I had the new groupId configured in pluginManagement and the old (or has it changed twice since 1.0?) groupId in plugins.

Also the <inherited>true</inherited> is unnecessary as well.

Show
Ben Tilford added a comment - - edited Just noticed that even with <inherited>true</inherited> being set in plugin management of the root pom and having the plugin in the root pom's build section that groovy tests do not run. The only way to get them to run is to copy the entire <plugin>...</plugin> (configuration and everything) into each sub project's <build> section. Ignore this issue. I found I had the new groupId configured in pluginManagement and the old (or has it changed twice since 1.0?) groupId in plugins. Also the <inherited>true</inherited> is unnecessary as well.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: