Hi Dominik,

this is the code fragment I use to clean multi projects.

maven.xml of the main project:

  <util:available file="${maven.multiproject.basedir}">
    <j:set var="multiproject.exists" value="true"/>
  </util:available>
  
  <postGoal name="clean">
    <j:if test="${context.getVariable('multiproject.exists')}">
      <j:set var="goal" value="clean"/>
      <attainGoal name="multiproject:goal"/>
    </j:if>
  </postGoal>

Only the main project sets maven.multiproject.basedir in project.properties. 
If the 'clean' goal of main project is called all subprojects are also 
cleaned.

Don't know if this is the best way to go -- but it's working.

-Chris

On Saturday 27 November 2004 16:05, Dominik Dahlem wrote:
> Hi all,
>
> I've been thinking about how to support a multiproject of multiprojects
> and couldn't find a working solution to it. I'm facing two problems:
> (1) If I could find out whether a project is a multiproject or not, it
> would be possible to just delegate the original command (e.g.
> "multiproject:goal -Dgoal=test") to the multiproject. Otherwise, "maven
> test" on a normal project. Are there mechanisms in maven which allow to
> do that?
> (2) If I overwrite the site goal in maven.xml of the multiproject to
> attain the site goal on each of its components the components themselves
> would inherit the overwritten site goal which ends up in an infinite
> build loop.
>
> Any help is appreciated.
> Thanks,
> Dominik

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to