You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Sam Wilson <nu...@gmail.com> on 2008/09/24 21:05:27 UTC

Run plugin after modules complete in multi-module project

Hello List,

I am putting together a multi-module project that I would like, at the end,
to bundle up two or three of the sub-modules into a .tar.gz with
accompanying documentation (app consists of multiple components that are
deployed separately).

I had started out with the idea of include a "meta-module" that would
execute last. This module would contain the documentation as well as the
maven-assembly plugin configuration to combine everything into the final
archive.

However, upon review of the maven-assembly plugin's descriptor doc I noticed
that it has built-in support for packaging sub-modules through the
<moduleSets> element.

I liked this idea better because it makes sense that the parent project
wraps up the child projects. It also means one fewer POM to keep around and
maintain.

Unfortunately it does not seem as though there is a way to attach this
assembly plugin to the root-pom project's lifecycle in such a way that it
will be run after all the child modules have been produced. So I am stuck
having to run this as a separate goal on the command-line. That's not a
terrible issue, but it just feels unclean.

I've done some searching and haven't found a way to do this. Have I missed
something? If not, does this make sense as something I should submit as a
feature request?

My thinking is that there should be some additional phases for multi-module
projects. For example: pre-modules and post-modules. Basically these would
be executed before/after all the submodules are addressed.

Thanks for your feedback.

Sam Wilson

Re: Run plugin after modules complete in multi-module project

Posted by Wendy Smoak <ws...@gmail.com>.
On Wed, Sep 24, 2008 at 12:05 PM, Sam Wilson <nu...@gmail.com> wrote:

> Unfortunately it does not seem as though there is a way to attach this
> assembly plugin to the root-pom project's lifecycle in such a way that it
> will be run after all the child modules have been produced. So I am stuck
> having to run this as a separate goal on the command-line. That's not a
> terrible issue, but it just feels unclean.

If you put the assembly in an additional child module, its
dependencies on other modules will naturally mean that it runs last.
You can use a goal that makes it part of the build, for example
'attached' or 'single'.

There is an example in the Continuum build [1] where the
continuum-jetty module builds the final assemblies.

[1] http://svn.apache.org/repos/asf/continuum/trunk/

-- 
Wendy

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org