I didn't explicitly create a report plugin. Maybe I should have. I'm not sure what the difference is between that and a "normal" plugin. Anyway, the javadoc plugin has an "aggregate" goal which creates a single file for all sub-modules. That all happens within that one execution of the plugin. I have a slightly different scenario where my plugin is aggregating the output of other plugins, so I have to orchestrate the order in which they run.
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Anders Hammar Sent: Friday, February 04, 2011 3:09 PM To: Maven Users List Subject: Re: Plugin running at the wrong time If I don't misunderstand things you're creating a report plugin? I'm not familiar with that and it could be different with normal plugins. Maybe have a look at the javadoc-plugin where javadocs are aggregated [1]? /Anders [1] http://maven.apache.org/plugins/maven-javadoc-plugin/aggregate-mojo.html On Fri, Feb 4, 2011 at 22:02, E S <[email protected]> wrote: > Thanks for the reference. I think what they're saying make sense. I > basically have to create another child module that is dependent on all the > other child modules that run units tests. This new module will run the > consolidation of the unit test reports. However, how do I set up the > dependencies so that the consolidator module waits until the others are > done > running their tests? > > On Wed, Feb 2, 2011 at 1:12 AM, Anders Hammar <[email protected]> wrote: > > > Please understand that your aggregating project (what you call "top level > > pom") runs first (thus your plugin binding is executed), then the modules > > (what you call "child poms") are built. > > So everything is as expected, but not what you want. :-) > > > > This "problem" is described in the FAQ for the maven-assembly-plugin [1]. > > Have a look there how it has been solved. > > > > /Anders > > > > [1] > > > > > http://maven.apache.org/plugins/maven-assembly-plugin/faq.html#module-bi naries > > > > On Wed, Feb 2, 2011 at 06:13, E S <[email protected]> wrote: > > > > > I have a maven project consisting of a top level pom and several child > > poms > > > under it. Each child project has a set of units tests that are output > by > > > surefire. I have written a custom plugin that will combine the results > of > > > all the sub-projects unit tests into a single file to be fed into our > > build > > > server. I would like for this plugin to be run during the package phase > > of > > > the top level build. The idea is that all the projects run their tests > > and > > > output their surefire reports during the test phase and then after that > > is > > > done, my plugin consolidates them during the package phase. In order to > > do > > > this, I have added the a reference to plugin to the top level pom > file's > > > build section like this: > > > > > > <build> > > > <finalName>whatever</finalName> > > > <plugins> > > > <plugin> > > > <groupId>my.plugin.group</groupId> > > > <artifactId>consolidator</artifactId> > > > <version>1.0-SNAPSHOT</version> > > > <inherited>false</inherited> > > > <executions> > > > <execution> > > > <id>execution1</id> > > > <phase>package</phase> > > > <goals> > > > <goal>junit</goal> > > > </goals> > > > <configuration> > > > <rootDir>${basedir}</rootDir> > > > <outFile>${basedir}/testresults.xml</outFile> > > > </configuration> > > > </execution> > > > </executions> > > > </plugin> > > > </plugins> > > > </build> > > > > > > The problem is that when I run the build, the consolidator plugin runs > > way > > > before the unit tests have gotten a chance to run. It's almost the > first > > > thing that gets run during the build. I can't figure out why this would > > > happen. I have clearly designated it to run during the package phase. > In > > > fact, when I use the plugin directly inside one of the sub-projects > (just > > > to > > > see if it would work) it runs at the correct time. What is different > > about > > > the top level pom? > > > > > > This message has been scanned for viruses by MailController - www.MailController.altohiway.com --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
