Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
None
Description
In a project with many modules that are able to build in parallel, if one fails the build, the output says to use -rf to resume from that module. However, this may not run the other modules that were running in parallel. If one of those modules also had failures, but had not yet reached those failures during the first build, and those modules aren't build in the second build, the build will pass, despite these 'hidden' errors.
In the example I've attached, there are four submodules, a, b, c and d. Module d depends on a, b, and c, and all modules share a common parent module.
The properties fail.a, fail.b, and fail.c will cause the respective module to fail.
Build first with just "mvn install -T4".
Next, imagine making a change in modules a, b, and c that break them, and build with "mvn install -T4 -Dfail.a -Dfail.b -Dfail.c"
Due to the timing in the test poms (using antrun sleep), this should print:
[ERROR] After correcting the problems, you can resume the build with the command [ERROR] mvn <goals> -rf :c
Above that, you will see it reporting the failure of all three modules, but in a lot of cases where there are surefire tests failing, it's extremely difficult to tell that more than one module failed. As a result, I generally just look at the module it's told me to resume from, to find failures.
So, pretend you've done that, but the errors in a and b remain, and run "mvn install -T4 -Dfail.a -Dfail.b -rf :c" as it's suggested.
The build passes, giving a false sense of confidence.