How to fix MojoFailureException while using spring too to build web project

One or more tests are not working.

Have a look at the files located at: /Users/charlesli/Documents/workspace-spring/WebApplication/target/surefire-reports (usually the bigger files contain a problem)

There you will find the test results, and the test that is broken. The Stacktrace containing in this file will guide you to the problem.

(BTW: you can run the tests in eclipse via JUnit plugin (Package explorer, right click, run as JUnit) too, then you will see the stack trace in the IDE and do not need to search in the files.)


I guess, that the DB connection is not correct. But this is only a guess.


Right click on Project-> Properties--> select project facets--> choose Java correct version which is installed on your system. Then it will works fine.