maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bruce Snyder <fer...@frii.com>
Subject Re: difference between reactor and multiproject
Date Thu, 04 Nov 2004 11:42:14 GMT
Feilpe Vieira Silva wrote:
> can you provide me your reactor configuration file ?
> 
> I´m doing my configuration file right now, but I´m having some newby problems...

I assume you're referrring to the maven.xml descriptor. Below is a small 
portion of the maven.xml that we set up:

<project xmlns:j="jelly:core"
     xmlns:a="jelly:ant"
     xmlns:m="jelly:maven"
     xmlns:util="jelly:util"
     default="default">

     <goal name="default" description="Build all modules">
         <attainGoal name="check:cwd"/>
         <m:reactor basedir="${basedir}"
             includes="modules/**/project.xml"
             excludes="modules/transformer/pcitoaces/persist/project.xml"
             goals="default"
             banner="Building: "
             ignoreFailures="false"/>
     </goal>

     <preGoal name="build:start">
         <!-- <attainGoal name="check:cwd"/> -->
         <attainGoal name="requireBuildProps"/>
         <attainGoal name="buildtype"/>
     </preGoal>

     <goal name="buildtype">
         <j:set var="build_type" value="${buildtype}"/>
         <j:if test="${build_type == null}">
             <j:set var="build_type" value="dev"/>
         </j:if>
         <echo>Build Type = '${build_type}'</echo>

         <j:if test="${!build_type.equals('dev') and 
!build_type.equals('test') and !build_type.equals('prod')}" >
             <echo>***********************************************</echo>
             <echo>****                                       ****</echo>
             <echo>**** buildtype must be dev, test, or prod  ****</echo>
             <echo>****                                       ****</echo>
             <echo>***********************************************</echo>
             <fail/>
         </j:if>

         <j:set var="var_name" value="${buildtype}.flipper.db.user"/>
         <j:set var="flipper.db.user" 
value="${context.getVariable(var_name)}"/>
         <j:set var="var_name" value="${buildtype}.flipper.db.user"/>
         <j:set var="flipper.db.password" 
value="${context.getVariable(var_name)}" />
         <j:set var="var_name" value="${buildtype}.flipper.db.user"/>
         <j:set var="flipper.db.url" 
value="${context.getVariable(var_name)}" />
         <j:set var="var_name" value="${buildtype}.flipper.db.user"/>
         <j:set var="quartz.db.user" 
value="${context.getVariable(var_name)}" />
         <j:set var="var_name" value="${buildtype}.flipper.db.user"/>
         <j:set var="quartz.db.password" 
value="${context.getVariable(var_name)}" />
         <j:set var="var_name" value="${buildtype}.flipper.db.user"/>
         <j:set var="quartz.db.url" 
value="${context.getVariable(var_name)}" />
         <j:set var="var_name" value="${buildtype}.flipper.db.user"/>
         <j:set var="jbm.db.user" 
value="${context.getVariable(var_name)}" />
         <j:set var="var_name" value="${buildtype}.flipper.db.user"/>
         <j:set var="jbm.db.password" 
value="${context.getVariable(var_name)}" />
         <j:set var="var_name" value="${buildtype}.flipper.db.user"/>
         <j:set var="jbm.db.url" value="${context.getVariable(var_name)}" />

     </goal>

     <goal name="requireBuildProps">

         <property name="project.name" 
value="${context.getProject().getName()}"/>
         <condition property="build.failure">
             <contains string="${user.dir}" substring="modules"/>
         </condition>
         <fail if="build.failure" message="${failure.msg}"/>

         <util:file var="buildProps" name="${user.dir}/build.properties"/>
         <j:if test="${buildProps.exists() == 'false'}">
             <echo>***********************************************</echo>
             <echo>***********************************************</echo>
             <echo>****                                       ****</echo>
             <echo>**** MISSING build.properties FILE AT ROOT ****</echo>
             <echo>****                                       ****</echo>
             <echo>***********************************************</echo>
             <echo>****                                       ****</echo>
             <echo>****            CANCELLING BUILD           ****</echo>
             <echo>****                                       ****</echo>
             <echo>***********************************************</echo>
             <echo>***********************************************</echo>
             <fail/>

         </j:if>
     </goal>

     <!-- Begin Commons goals -->
     <goal name="commons:default" description="Builds the commons module">
         <m:reactor basedir="${basedir}"
             includes="modules/commons/project.xml"
             goals="default"
             banner="Building: "
             ignoreFailures="false"/>
     </goal>
     <!-- End Commons goals -->

     <!-- Begin Console goals -->
     <goal name="console:default" description="Build the war file">
         <attainGoal name="check:cwd"/>
         <m:reactor basedir="${basedir}"
             includes="modules/console/project.xml"
             goals="default"
             banner="Building Console war: "
             ignoreFailures="false"/>
     </goal>

     <goal name="console:webdoclet" description="Builds the struts 
validation.xml">
         <m:reactor basedir="${basedir}"
             includes="modules/flipperconsole/project.xml"
             goals="webdoclet"
             banner="WEBDoclet: "
             ignoreFailures="false"/>
     </goal>

     <!-- Begin EAR goals -->
     <goal name="deploy:ear" prereqs="default">
         <m:reactor basedir="${basedir}"
             includes="modules/ear/project.xml"
             goals="deploy:ear"
             ignoreFailures="false"
             banner="Deploying: " />
     </goal>

     <goal name="clean:deploy:ear">
         <attainGoal name="check:cwd"/>
         <attainGoal name="clean"/>
         <attainGoal name="deploy:ear" />
     </goal>
     <!-- End EAR goals -->

     ...

</project>

It continues on from here for almost every module. The check:cwd goal 
assures that you're sitting in the top level dir when building. This is 
because I haven't found a way to build from down in one of the 
subprojects. The problem is that we've got interdependencies between 
subprojects and when you try to build from down in a subproject maven 
can't find any of the interdependencies. There may be a way around this, 
but I haven't found it yet.

Bruce
-- 
perl -e 'print 
unpack("u30","<0G)U8V4\\@4VYY9&5R\\"F9E<G)E=\\$\\!F<FEI+F-O;0\\`\\`");'

The Castor Project
http://www.castor.org/

Apache Geronimo
http://geronimo.apache.org/

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


Mime
View raw message