Kind of  a hack, but we do this like so:

<j:set var="subProjects" value="bootsoft-common/project.xml,cbdata/project.xml"/>

<goal name="cb:build">
        <maven:reactor basedir="${maven.multiproject.basedir}"
             includes="${subProjects}"
             goals="cb:build"
             banner="Installing"
             ignoreFailures="false" />
     <echo>Sub Projects Built... time to war</echo>
     <attainGoal name="war:war"/>
</goal>

On Jan 31, 2005, at 4:35 PM, Brian Cochran wrote:

Sorry to cross post, but I wanted to see the reaction from the maven
userbase as to the demand for a new type of reactor tag.
-------
Forgive me if someone has already discussed this but I thought it was
important to volunteer an idea.


Suppose you set up projects using a flat, not hierarchal directory structure. In this case I want to rely on the project.xml dependency structures only to designate parent and child projects. We use this structure to obtain an m to n mapping between "deliverable projects (zips, ears, wars, etc.) and component projects (jars, wars, etc.) thus encouraging more project Independence.

Here is an example of how we would set up a couple different J2EE projects.

projects/
           /core-jar-project
           /ejb-jar project
           /war-one-project
           /ear-one-project
           /war-two-project
           /database-one-project (this may produce a zip file that can
be extracted and run on  a database)
           /database-two-project

           /deployable-one-project (maybe this is a zip of the ear-one
and database-one)
           /deployable-two-project

The two deliverable projects "one" and "two" above are relying on a
core set of components, but are not separated by folder structure. The
hierarchy is described completely in the project.xml's dependencies,
not the folder hierarchy. This of course also means that each
developer can organize the projects in his or her development
environment however he feels necessary. Adding a new project is also
easier. For example, creating a project "three" would not involve
duplicating the hierarchy of the individual components.

Of course the problem arises when one wants to do a multi project
build for a specific deliverable. In the above example, this is very
difficult as doing a regular multi project reactor based build will
build project "one" and project "two" even though I am only working on
project "one".

To address this issue, we built a new tag based on the reactor tag
called reconcile. This tag behaves very similarly to the reactor tag,
but instead of finding the relationships between all projects. It only
searches dependent projects from the current project. For example, I
execute the following command to build all components (that I have
checked out) relating to project one.

projects/deployable-one-project> maven reconcile:install

This would cause all projects in the dependency chain of project one
to build, but not project two.



If anyone is interested in this, please let me know.

Thanks,
Brian

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

Reply via email to