Reputation: 621
I am facing a problem that when I am trying to build the project it fails on:
Surefire report directory: C:\...
------------------------------------------------------
T E S T S
-------------------------------------------------------
Running com.energyict.projects.customer.coop.ems.exporters.ClassTestName
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.052 sec <<< FAILURE!
Running com.energyict.projects.customer.coop.ems.exporters.AnotherClassTestName
Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.225 sec
Results :
Tests in error:
initializationError(path for class here)
Tests run: 8, Failures: 0, Errors: 1, Skipped: 0
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] There are test failures.
It happens when Maven tries to run test files, but if I run any single test - it works fine.
Why every single test works fine, but when I am trying to build the project it fails on tests?
Could anyone please give a suggestion?
UPDATE: more logs added.
Please refer to 'class path'\trunk\target\surefire-reports for the individual test results.
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:715)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
Caused by: org.apache.maven.plugin.MojoFailureException: There are test failures.
Please refer to 'class path'\trunk\target\surefire-reports for the individual test results.
at org.apache.maven.plugin.surefire.SurefirePlugin.execute(SurefirePlugin.java:575)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
... 22 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 15 seconds
[INFO] Finished at: Thu Jun 29 19:23:06 MSK 2017
[INFO] Final Memory: 74M/721M
[INFO] ------------------------------------------------------------------------
Upvotes: 1
Views: 1577
Reputation:
When we build our project maven will unable to build test classes so we use the command like this to uncompile the test classes.
-e clean install -Dmaven.test.skip=true
Upvotes: 1