I put this in my maven.xml to usurp the normal multiproject:clean. It uses
the multiproject logic to figure out which projects actually need cleaning,
but then uses the clean:clean "payload" directly. It seems to work well
enough.
<goal name="multiproject:clean">
<m:reactor basedir="${maven.multiproject.basedir}"
banner="Gathering project list"
includes="${maven.multiproject.includes}"
excludes="${maven.multiproject.excludes}"
postProcessing="true"
ignoreFailures="${maven.multiproject.ignoreFailures}"
collectOnly="true" />
<j:forEach var="reactorProject" items="${reactorProjects}">
<!-- this list of things to delete is lifted from
clean:clean -->
<ant:delete
dir="${reactorProject.context.getVariable('maven.build.dest')}" />
<ant:delete
dir="${reactorProject.context.getVariable('maven.build.dir')}" />
<ant:delete
file="${reactorProject.context.getVariable('basedir')}/velocity.log"
quiet="true"
failonerror="false" />
</j:forEach>
</goal>
-----Original Message-----
From: James Richardson [mailto:[EMAIL PROTECTED]
Sent: 14 January 2005 11:21
To: [email protected]
Subject: "Clean" target still requires dependencies
Hi,
Using cruise, I have a multiproject, but I have some problems running, as
even when running the "clean" target, maven will check the dependencies.
The dependencies will not be there, cause they haven't been built yet, and
so the build will fail.
I run the following goal from cruise (taken from my maven.xml):
<goal name="fullbuild">
<attainGoal name="scm:update-project" />
<attainGoal name="clean" />
<attainGoal name="multiproject:build" />
<attainGoal name="multiproject:site" />
</goal>
<preGoal name="clean">
<attainGoal name="multiproject:clean" />
</preGoal>
So, if somebody checks in a new module to the project, which has a
dependency of some other module (also not yet checked in), then the build
will fail. This is expected. However, the build will never then complete,
as the next time cruise runs (assuming the other module has been checked
in now), the clean target will run before building. There will be no
dependent project in the cruise repository, while running the clean task,
thus the build will fail again, even though the right code is now there.
The only way to fix the problem is to remove the dependency from the
project, wait until the dependency has built (only once), then you can add
the dependency back into the component project.xml.
Does this sound right? Would it be fixed by making "clean" not check
dependencies, would this break anything else?
Best Regards,
James
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]