Mike,
You can accomplish this by setting the maven.test.failure.ignore property
to true in your project.properties and then using the following jelly script
in your maven.xml file:
<project xmlns:j="jelly:core">
<postGoal name="test:test">
<echo message="In the postGoal" />
<j:if test="${maven.test.failure}">
<echo message="Test failure"/>
<fail message="There were unit test failures"/>
</j:if>
</postGoal>
</project>
I hope this helps!
Rod
On 6/24/05, Michael Deck <[EMAIL PROTECTED]> wrote:
>
> Hello All -
>
> I am trying to understand exactly how and when postGoals are executed.
> Based on reading the werkz project documentation it seems that a postGoal
> should be executed regardless of the success of failure of the goal upon
> which it acts, but this does not seem to be the case. I've set up a very
> simple example to illustrate.
>
> First I set up a new maven project using genapp and the default template.
> Then I added a test in AppTest.java that will always fail.
>
> Now when I call "maven test" I get a build failed message as expected.
>
> Next I added the following to maven.xml
>
> <project>
> <postGoal name="test:test">
> <echo message="In the postGoal" />
> </postGoal>
> </project>
>
> Now I would expect to see this message echoed after the junit tests are
> run but this is not the case.
>
> Is my understanding of postGoals wrong, or am I missing something in the
> implementation? If it is true that a postGoal does not execute if the parent
> goal fails, then is is possible to get maven to execute a goal after running
> tests even if they do fail (e.g. copy some output files to a log
> directory)?
>
> Any explination would be much appreciated.
>
> Thanks,
> Mike
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>