You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Alexei Barantsev <ba...@kazbek.ispras.ru> on 2003/01/29 09:47:39 UTC

Fail on second attained goal that uses reactor

Let's imagine a simple project that have a subproject.

Parent's maven.xml (see below) defines two goals (run1 and run2) that
use reactor to do something with the subproject, and two goals (run12
and run21) that attain goals run1 and run2 in different order.

Goals run1 and run2 works as expected whereas goals run12 and run21 do
not - they execute first attained goal and then fail on second.

What's the matter?

<SESSION_LOG>
bash-2.05a$ maven run12
...
Starting the reactor ...
Our processing order:
subproject
+----------------------------------------
| Building subproject
+----------------------------------------
...
Starting the reactor ...
Our processing order:
subproject
+----------------------------------------
| Cleaning subproject
+----------------------------------------

BUILD FAILED
Unknown goal "clean"
Total time:  4 seconds

bash-2.05a$ maven run21
...
Starting the reactor ...
Our processing order:
subproject
+----------------------------------------
| Cleaning subproject
+----------------------------------------
...
Starting the reactor ...
Our processing order:
subproject
+----------------------------------------
| Building subproject
+----------------------------------------

BUILD FAILED
Unknown goal "java:jar"
Total time:  4 seconds

</SESSION_LOG>

<PARENT_PROJECT_XML>
<?xml version="1.0" encoding="UTF-8"?>
<project default="run" xmlns:maven="jelly:maven">

    <goal name="run12">
        <attainGoal name="run1"/>
        <attainGoal name="run2"/>
    </goal>

    <goal name="run21">
        <attainGoal name="run1"/>
        <attainGoal name="run2"/>
    </goal>

    <goal name="run1">
        <maven:reactor
          basedir="${basedir}"
          includes="*/project.xml"
          goals="java:jar"
          banner="Building"
          ignoreFailures="false"
          />
    </goal>

    <goal name="run2">
        <maven:reactor
          basedir="${basedir}"
          includes="*/project.xml"
          goals="clean"
          banner="Cleaning"
          ignoreFailures="false"
          />
    </goal>

</project>
</PARENT_PROJECT_XML>