// DUNS, changed name public void narExecute() throws MojoExecutionException, MojoFailureException { if (verifyParameters()) { super.narExecute(); SurefireBooter surefireBooter = constructSurefireBooter(); getLog().info("Surefire report directory: " + reportsDirectory); int result; try { result = surefireBooter.run(); } catch (SurefireBooterForkException e) { throw new MojoExecutionException(e.getMessage(), e); } catch (SurefireExecutionException e) { throw new MojoExecutionException(e.getMessage(), e); } if (originalSystemProperties != null && !surefireBooter.isForking()) { // restore system properties, only makes sense when not forking.. System.setProperties(originalSystemProperties); } if (result == 0) { return; } String msg; if (result == SurefireBooter.NO_TESTS_EXIT_CODE) { if ((failIfNoTests == null) || !failIfNoTests.booleanValue()) { return; } // TODO: i18n throw new MojoFailureException( "No tests were executed! (Set -DfailIfNoTests=false to ignore this error.)"); } else { // TODO: i18n msg = "There are test failures.\n\nPlease refer to " + reportsDirectory + " for the individual test results."; } if (testFailureIgnore) { getLog().error(msg); } else { throw new MojoFailureException(msg); } } }