Stephen McConnell wrote:
Jon Elson-Green wrote:
Hi all,
I've been sorting through all the appropriate properties files and entries and have finally decided it's time to ask for help.
Basically, when I run maven from the top level directory and the reactor descends into each of my subproject, (component), directories it appears to me that ${merlin.dir} remains set at the top level dir.
Am I right in assuming the ${merlin.dir} = ${basedir} and ${basedir} isn't changed by the reactor, (this just seems wrong to me)?
${merlin.dir} == ${basedir}
When running a reactor build - maven sets the ${basedir} separately for each project in the reactor run. So for example - if you have a project structure like the following:
/utilities /api /payment /credit /load
.. and if you run a reactor build from the utilities directory (and presuming that you have a project.xml in api, payment, credit and loan), then the ${basedir} set by maven will be /utilities/api for the api project, /utilities/payment for the payment project, etc.
Each of my subprojects have merlin.properties files for testing with relative
${merlin.deployment} and ${merlin.override} paths and when the
reactor runs these fail because they are relative to the top level directory.
Umm - that's not the behavior I'm seeing. Here is an example of a reactor definition that works properly:
<goal name="avalon:build"> <maven:reactor basedir="${basedir}" includes="*/project.xml" excludes="project.xml,target/**" goals="jar:install" banner="Building:" ignoreFailures="false" postProcessing="false" /> </goal>
Could post to the list the reactor defintion your using.
Stephen.
Naturally they succeed when run from within the subproject.
Can someone enlightenment on how or where to find the answer to this?
Nothing unusual looking there:
<goal name="build-components" description="build the system jars." > <maven:reactor basedir="${basedir}" includes="component/**/project.xml" banner="Building Components:" goals="jar:install" ignoreFailures="false" postProcessing="true" />
<!-- snipped out j:forEach copy -->
/> The info from the merlin testcase shows:
${user.dir} is the top level directory
${merlin.dir} is the subproject directory
${merlin.override} is relative to ${user.dir}
${merlin.deployment} is relative to ${user.dir}
p.s. this is 3.2.5
This seems entrenched, I have overcome it with a merlin.properties template file in which I make an absolute path for merlin.deployment which is ${basedir}/mycustomtarget instead of ${user.dir}:
merlin.properties.src: [EMAIL PROTECTED]@/target/customtest1 merlin.override=target/customtest1/conf/config.xml
maven.xml addition:
<preGoal name="test:test">
<ant:copy file="merlin.properties.src" tofile="merlin.properties" overwrite="true" />
<ant:replace file="merlin.properties" token="@basedir@" value="${basedir}" />
</preGoal>
Jon
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
