3

When I do Maven build on my project I get the following:

[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] There are test failures.

Please refer to .

However, all my surefire reports show 0 failures and 0 errors.

Any ideas what could cause this or how to find out?

Regards,

Olli

user567602
  • 909
  • 1
  • 9
  • 15
  • 1
    I think you must be oversight something cause the line `[INFO] There are test failures.` shows there are tests which have failed... – khmarbaise Mar 24 '15 at 16:54

3 Answers3

0

This could be because of inadequate memory issue on the computer.

Running the maven build by redirecting the logs to a separate log file resolved the problem for me

mvn clean install > log-file.log

Please note that since if inadequate memory is really the issue (like in my case) then it also depends on the command we are executing. For example, mvn clean install eclipse:clean eclipse:eclipse command worked fine when the logs are redirected to a file instead of console but when I used the maven command with -X flag and ran the command then I faced the problem again even though I redirected the output to log file

Please see below answers which might be similar issue:

The forked VM terminated without saying properly goodbye. VM crash or System.exit called

firstpostcommenter
  • 2,328
  • 4
  • 30
  • 59
0

I had the same issue after upgrading my project from Java 8 to 9.

My tests passed when running from my IDE, but failed when run with maven, and all surefire reports were clean, no failures.

Then I opened an html surefire report found in ${project_dir}/target/surefire-reports/testng-junit-results where I saw the whole stack trace from that one failure and it had something to do with java.base module which I had problems with before (the standard Java 9 modules accessibility issues) so I realized I had to add a few --add-opens flags in my surefire plugin argLine:

--add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED 
--add-opens=java.base/jdk.internal.loader=ALL-UNNAMED

This issue was super frustrating because the errors were not intuitive, I still don't understand why it just didn't say "module java.base does not "opens jdk.internal.loader" to unnamed module" like I've seen before.

-1

Check the version of surefire used and make sure it's up to date. That might be enough to let you see the reason for the failure, if not correct the problem entirely.

If the same problem persists, temporarily set the forkCount property to 0 and re-run the build. I have seen Surefire swallow exceptions from forked processes before. If this is what's happening, not using a fork will let you see the exception so you may correct the issue.

user944849
  • 14,524
  • 2
  • 61
  • 83