Error generating html reports via exec-maven-plugin

495 views
Skip to first unread message

Graham Berks

unread,
Feb 5, 2012, 3:32:31 AM2/5/12
to Cukes
Hi, this is failing in our automated jenkins builds with a weird error
that states an error happened with return code of 0.

Am wondering if it's the line in the Main -
System.exit(runtime.exitStatus()); that is causing this. All reports
are produced correctly yet the build fails, which I'm guessing is due
to a system.exit as we are running the build in process using the java
option of exec-maven-plugin.

Any ideas ? Is the System.exit need when there is no error ?

Thanks

Robert

unread,
Feb 5, 2012, 1:09:58 PM2/5/12
to cu...@googlegroups.com
I am not able to reproduce this error when I run a simple test project via the command-line -- my exit code is 0.  What does your pom file look like? 

Graham Berks

unread,
Feb 5, 2012, 1:54:59 PM2/5/12
to Cukes
It's that exec-maven-plugin via the java option runs in-process, hence
issuing System.exit(0) is killing the the outside process.

Will post the pom tomorrow when i'm back at work.

Thanks

aslak hellesoy

unread,
Feb 5, 2012, 2:34:53 PM2/5/12
to cu...@googlegroups.com
On Sun, Feb 5, 2012 at 6:54 PM, Graham Berks <gra...@fatlazycat.com> wrote:
It's that exec-maven-plugin via the java option runs in-process, hence
issuing System.exit(0) is killing the the outside process.


So System.exit(1) would also kill the outside process, right?
How then would Cucumber (or any process started by exec-maven-plugin for that matter) signal a failure?

Aslak
 
Will post the pom tomorrow when i'm back at work.

Thanks

--
You received this message because you are subscribed to the Google Groups "Cukes" group.
To post to this group, send email to cu...@googlegroups.com.
To unsubscribe from this group, send email to cukes+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/cukes?hl=en.


Graham Berks

unread,
Feb 5, 2012, 2:46:02 PM2/5/12
to Cukes
Possibly be fine, but never seen a System.exit(0) before.

What do you recommend to run the reports with ? I guess we could use
the antrun plugin.

Jason H

unread,
Jul 19, 2012, 1:41:58 PM7/19/12
to cu...@googlegroups.com
I know I'm necro-posting a bit here, but this is precisely what we've been struggling with. Jenkins fails our tests, executed by exec-maven-plugin, with "ERROR: Maven JVM terminated unexpectedly with exit code 0", even though all of the actual cuke tests are green. Our project specifically is setup to run Groovy tests from Maven, a la Cuke4Duke (although from reading about this exit code 0 thing, it seems to be cucumber-jvm pervasive issue in Jenkins config).

Rex Hoffman

unread,
Jul 19, 2012, 11:45:43 PM7/19/12
to cu...@googlegroups.com
I do this:

right now the hacked runner, actually just extends Main so it isn't hacked at all..... the reporters are however.

<plugin>

<groupId>org.codehaus.mojo</groupId>

<artifactId>exec-maven-plugin</artifactId>

<executions>

<execution>

<id>Domestic Cucumber Step Tests</id>

<phase>test</phase>

<goals>

<goal>exec</goal>

</goals>

<configuration>

<arguments>

<argument>-ea</argument>

<argument>-DtargetAppType=WebApp</argument>

<argument>-classpath</argument>

<classpath />

<argument>cucumber.hackedrunner.HackedRunner</argument>

<argument>classpath:</argument>

<argument>--glue</argument>

<argument>com.hotwire.test.steps</argument>

<argument>--format</argument>

<argument>gherkin.formatter.FixedPrettyFormatter</argument>

<argument>--format</argument>

<argument>cucumber.formatter.JUnitFormatter:target/surefire-reports/TEST-HTMLReportUS.xml</argument>

<argument>--format</argument>

<argument>cucumber.formatter.EnhancedHTMLFormatter:target/cucumber/HTMLReportUS</argument>

                <argument>--format</argument>

                <argument>json:target/cucumber_us.json</argument>

<argument>--monochrome</argument>

<argument>--tags</argument>

<argument>@US</argument>

</arguments>

</configuration>

</execution>

<execution>

<id>Mobile Cucumber Step Tests</id>

<phase>test</phase>

<goals>

<goal>exec</goal>

</goals>

<configuration>

<arguments>

<argument>-ea</argument>

<argument>-DtargetAppType=MobileWebApp</argument>

<argument>-classpath</argument>

<classpath />

<argument>cucumber.hackedrunner.HackedRunner</argument>

<argument>classpath:</argument>

<argument>--glue</argument>

<argument>com.hotwire.test.steps</argument>

<argument>--format</argument>

<argument>gherkin.formatter.FixedPrettyFormatter</argument>

<argument>--format</argument>

<argument>cucumber.formatter.JUnitFormatter:target/surefire-reports/TEST-HTMLReportMobile.xml</argument>

<argument>--format</argument>

<argument>cucumber.formatter.EnhancedHTMLFormatter:target/cucumber/HTMLReportMobile</argument>

                <argument>--format</argument>

                <argument>json:target/cucumber_mobile.json</argument>

<argument>--monochrome</argument>

<argument>--tags</argument>

<argument>@MOBILE</argument>

</arguments>

</configuration>

</execution>

<execution>

<id>Row (Rest Of World) Cucumber Step Tests</id>

<phase>test</phase>

<goals>

<goal>exec</goal>

</goals>

<configuration>

<arguments>

<argument>-ea</argument>

<argument>-DtargetAppType=RowWebApp</argument>

<argument>-Dapplication_url=http://www.qaci.hotwire.com/intl</argument>

<argument>-classpath</argument>

<classpath />

<argument>cucumber.hackedrunner.HackedRunner</argument>

<argument>classpath:</argument>

<argument>--glue</argument>

<argument>com.hotwire.test.steps</argument>

<argument>--format</argument>

<argument>gherkin.formatter.FixedPrettyFormatter</argument>

<argument>--format</argument>

<argument>cucumber.formatter.JUnitFormatter:target/surefire-reports/TEST-HTMLReportRow.xml</argument>

<argument>--format</argument>

<argument>cucumber.formatter.EnhancedHTMLFormatter:target/cucumber/HTMLReportRow</argument>

                <argument>--format</argument>

                <argument>json:target/cucumber_row.json</argument>

<argument>--monochrome</argument>

<argument>--tags</argument>

<argument>@ROW</argument>

</arguments>

</configuration>

</execution>

</executions>

<configuration>

<classpathScope>test</classpathScope>

<executable>java</executable>

<successCodes>

<successCode>2</successCode>

<successCode>1</successCode>

<successCode>0</successCode>

</successCodes>

</configuration>

</plugin>


Hope this helps
Reply all
Reply to author
Forward
0 new messages