Original problem from the cloned issue:
Clover database contains FileInfo objects for every source file. One of FileInfo fields is an absolute path to given file. When database is written, it uses current platform file separator for file name ('\' for windows, '/' for Linux/MacOS). However, when database is read it interprets file name using again current platform file separator.
As a consequence, when database is generated on Windows and report generated on Linux, it cannot resolve file name properly - it takes whole path as a single path segment, resulting in paths like:
As a consequence report generation does create html file containing source code with highlighted coverage.
Problem with the clover2:clover goal:
The clover2:clover call <clover-report> using a default report descriptor (which is located in the maven-clover2-plugin-X.X.X.jar/default-clover-report.xml). This report descriptor has a reporting defined like:
i.e. there is no <sourcepath> property.
Possible fix #1:
- add the <sourcepath> property
- set it's value to a list of standard source roots, similarly as it's done for <testsources> tag
excerpt from the CloverReportMojo:
excerpt from the default-clover-report.xml:
so it could be like this:
potential problem: build may have source roots different than src/test/xxx and src/main/xxx; in such case sources would not be found; it means that settings this <sourcepath> property should be optional; it could be done via boolean flag
Possible fix #2:
- add the <sourcepath> property to the clover2:clover goal
- if it's not null then pass it's value to the <sourcepath> property in the <clover-report> goal in the report descriptor
potential problem: how developers could easily find all source roots in all modules in their maven project in order to pass it as the property?