You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Eric Fetzer <el...@yahoo.com> on 2011/12/06 20:38:46 UTC

Mvn Not Returning Error

Yesterday, I had a test fail and fail out a build, but it didn't return to ant a bad return code.  Here's what I have:
 
Ant call to maven:
 
      <exec dir="${dir.app}" executable="mvn">
        <arg line="clean install"/>
      </exec>
 
Maven call to tests:
 
                        <plugin>
                                <groupId>org.apache.maven.plugins</groupId>
                                <artifactId>maven-surefire-plugin</artifactId>
                                <configuration>
                                        <includes>
                                                <include>**/*Test.java</include>
                                        </includes>
                                </configuration>
                        </plugin>

Build output indicating error:
 
     [exec] Tests run: 281, Failures: 0, Errors: 1, Skipped: 55
     [exec]
     [exec] [INFO] ------------------------------------------------------------------------
     [exec] [ERROR] BUILD FAILURE
     [exec] [INFO] ------------------------------------------------------------------------
     [exec] [INFO] There are test failures.
     [exec]
     [exec] Please refer to /app/path/to/target/surefire-reports for the individual test results.
     [exec] [INFO] ------------------------------------------------------------------------
     [exec] [INFO] For more information, run Maven with the -e switch
     [exec] [INFO] ------------------------------------------------------------------------
     [exec] [INFO] Total time: 1 minute 51 seconds
     [exec] [INFO] Finished at: Mon Dec 05 14:56:40 MST 2011
     [exec] [INFO] Final Memory: 71M/324M
     [exec] [INFO] ------------------------------------------------------------------------
     [exec] Result: 1
     [echo] Finished compile
 
I'm not involved in the development of the mvn code, only the ant.  Can anybody offer some advise in tracking down why this guy is returning a 0 when he didn't even get to the compile task?
 
Thanks,
Eric

Re: Mvn Not Returning Error

Posted by Stephen Connolly <st...@gmail.com>.
the line

[exec] Result 1

is coming from Ant and saying mvn returned exit code 1.... which is mvn
saying i had an error....

looks like an issue with your ant tasks, maven is doing what you ask

- Stephen

---
Sent from my Android phone, so random spelling mistakes, random nonsense
words and other nonsense are a direct result of using swype to type on the
screen
On 6 Dec 2011 19:39, "Eric Fetzer" <el...@yahoo.com> wrote:

> Yesterday, I had a test fail and fail out a build, but it didn't return to
> ant a bad return code.  Here's what I have:
>
> Ant call to maven:
>
>       <exec dir="${dir.app}" executable="mvn">
>         <arg line="clean install"/>
>       </exec>
>
> Maven call to tests:
>
>                         <plugin>
>                                 <groupId>org.apache.maven.plugins</groupId>
>
> <artifactId>maven-surefire-plugin</artifactId>
>                                 <configuration>
>                                         <includes>
>
> <include>**/*Test.java</include>
>                                         </includes>
>                                 </configuration>
>                         </plugin>
>
> Build output indicating error:
>
>      [exec] Tests run: 281, Failures: 0, Errors: 1, Skipped: 55
>      [exec]
>      [exec] [INFO]
> ------------------------------------------------------------------------
>      [exec] [ERROR] BUILD FAILURE
>      [exec] [INFO]
> ------------------------------------------------------------------------
>      [exec] [INFO] There are test failures.
>      [exec]
>      [exec] Please refer to /app/path/to/target/surefire-reports for the
> individual test results.
>      [exec] [INFO]
> ------------------------------------------------------------------------
>      [exec] [INFO] For more information, run Maven with the -e switch
>      [exec] [INFO]
> ------------------------------------------------------------------------
>      [exec] [INFO] Total time: 1 minute 51 seconds
>      [exec] [INFO] Finished at: Mon Dec 05 14:56:40 MST 2011
>      [exec] [INFO] Final Memory: 71M/324M
>      [exec] [INFO]
> ------------------------------------------------------------------------
>      [exec] Result: 1
>      [echo] Finished compile
>
> I'm not involved in the development of the mvn code, only the ant.  Can
> anybody offer some advise in tracking down why this guy is returning a 0
> when he didn't even get to the compile task?
>
> Thanks,
> Eric

Re: Mvn Not Returning Error

Posted by Eric Fetzer <el...@yahoo.com>.
Good catch, I thought failonerror defaulted to true in exec.  Thanks!



On Dec 6, 2011, at 3:21 PM, Wayne Fay <wa...@gmail.com> wrote:

>>     [exec] Result: 1
>>     [echo] Finished compile
> 
> That looks like a return of 1 to me. Why do you think it returned a 0?
> 
> Are you missing failonerror="true" or resultproperty in your Ant exec statement?
> 
> Wayne
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Mvn Not Returning Error

Posted by Wayne Fay <wa...@gmail.com>.
>      [exec] Result: 1
>      [echo] Finished compile

That looks like a return of 1 to me. Why do you think it returned a 0?

Are you missing failonerror="true" or resultproperty in your Ant exec statement?

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org