Add rerunFailingTests option for maven surefire to rerun failing tests i...

Add rerunFailingTests option for maven surefire to rerun failing tests immediately after they fail. Each single test method now maintains a list of its runs. DefaultReporterFactory now contains a few maps between test and the list of all its runs. If a test passes in any of its reruns, the build will be marked as successful and the test will count as flake.
I think it would be better to rerun the failing tests of a class immediately after that class finished. For once, this would help for people who configure their tests to run in alphabetical order. Secondly, when using multiple forks, it would improve the balance between the runtime of the individual forks, as each fork will fetch the next class to execute only when the former class was actually finished (including reruns).

Do you think that would be possible?