Ignore absent code directories when aggregating report #466
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Current state
Currently, the ReportAggregator builder requires all code directories it works with to be non null, to exist, and to actually be directories. This is standard argument checking and it works just fine for most cases.
However, this behavior is problematic with some maven project structures.
In a maven project using submodules, one may choose to add a non standard source directory. This may be configured in the root pom and applied to all submodules. If this directory has a special purpose, for instance code generated by a given tool, it may not be used by all submodules.
In such a project, when listing source directories, plugins will see the additional source folder everytime, even for submodules where it is not used.
Because of the checks done in ReportAggregator, pitest report aggregation fails when this directory is not present.
Proposed solution
Some maven plugins works fine in the same situation, for instance, maven-resources-plugin just logs that a given folder was not found and continues its execution.
I propose we do the same here.