private static void checkSurefireVersion ( Object mojo ) throws Exception { try { // Check version specific methods/fields. // mojo.getClass().getMethod(GET_RUN_ORDER); getField ( SKIP_TESTS_FIELD , mojo ) ; getField ( FORK_MODE_FIELD , mojo ) ; // We will always require the following. getField ( ARGLINE_FIELD , mojo ) ; getField ( EXCLUDES_FIELD , mojo ) ; } catch ( NoSuchMethodException ex ) { throwMojoExecutionException ( mojo , "Unsupported surefire version. An alternative is to use select/restore goals." , ex ) ; } }
Checks that Surefire has all the metohds that are needed i . e . check Surefire version . Currently we support 2 . 7 and newer .