Project: clover
Issue CLOV-1415: The clover2:clover goal does not pass the sourcepath property to underlying <clover-report> task
*Original problem from the cloned issue:* {quote} 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: /path/from/report/generation/sourcepath/D:/path/from/instrumented/build/file.java As a consequence report generation does create html file containing source code with highlighted coverage. {quote} *Problem with the clover2:clover goal:* The clover2:clover call 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: {code:xml} {code} i.e. there is no property. Possible fix #1: * add the property * set it's value to a list of standard source roots, similarly as it's done for tag _excerpt from the CloverReportMojo:_ {code:java} antProject.setProperty("testPattern", "**/src/test/**"); {code} _excerpt from the default-clover-report.xml:_ {code:xml} ... {code} so it could be like this: {code:java} antProject.setProperty("sourceRootsPattern", "**/src/test/*;**/src/main/*"); ... {code} (!) 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 property should be optional; it could be done via boolean flag Possible fix #2: * add the property to the clover2:clover goal * if it's not null then pass it's value to the property in the 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?
Story points: 2