Rod - Thanks for the idea, but it seems like this is just a work around specific to the test goal. For instance, what if I want to do the same thing for the java:compile goal? There isn't an ignore compile errors properties on the java plug-in is there? (please correct me if I am wrong) So this same solution wouldn't work. It seems to me that the goal processing framework should provide some mechanism for executing tasks after a goal regardless of it's outcome. And as I said before, the documentation on the Werkz project describes a postGoal as being exactly that, so I'm wondering why it doesn't seem to work that way in Maven. And, if a postGoal indeed does not execute when the parent goal fails, what is the difference between a postGoal and a postAction? Thanks again. -Mike
________________________________ From: Rod Coffin [mailto:[EMAIL PROTECTED] Sent: Sat 6/25/2005 10:57 AM To: Maven Users List Subject: Re: postGoal execution conditions 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] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
