Is source code location hardcode in clover registry file?

I'm now facing some problem with maven clover plugin, I have 2 separate maven projects: one from DEV and one from QA, and they are executed on different hosts, details:

host1: a Windows host where I instrument DEV's source code and build project(DEV's maven project)


host2: a Linux host where I run integration tests and generate report(QA's maven project)

		<contextFilters>logger, iflogger, log, iflog</contextFilters>

The problem is:

After I copy the build file with instrumented classes and clover database from host1 to host2, then I execute test and generate clover report on host2 by executing command: mvn test clover2:clover, following error return, D:/perforce/depot/..../ is the location on host1 where source code place.

[ERROR] Failed to render syntax highlights for /app/QA/D:/perforce/depot/..../ D:/perforce/depot/..../ (No such file or directory) D:/perforce/depot/..../ (No such file or directory) D:/perforce/depot/Solutions/EAS/eas/Main/core/eas-service/src/main/java/com/emc/documentum/eas/service/order/ (No such file or directory)

I'm wondering is there any solution can resolve my problem?

4 answers

Anyone who meet the same problem, please go the solution.

I'm using Clover 3.1.10, the problem I'm facing now is exactly match what described in CLOV-1112, instrument on Windows and generate report on linux, db file record each source file's absolute path, which resulting win-linux paths like:

[ERROR] Failed to render syntax highlights for /app/QA/D:/perforce/depot/..../

As you mentioned CLOV-1112 is mark as resloved in 3.1.7, but now seems it's still reproducible in 3.1.10.

BTW, I'm using clover maven plugin, details please check my post:,



0 votes

A problem is indeed similar to CLOV-1112, but it's not caused by a bug in later Clover versions, but by a fact that the Maven clover2:clover goal does not pass the "sourcepath" property to the report task. Unfortunately, there's no "sourcepath" configuration option for the clover2:clover goal.

Issue report:

An improvement for it is reported here:


Use a custom report configuration:

1. Define the clover2:clover reportDescriptor tag in pom.xml, pointing to a file with a custom report configuration.

2. Define a custom report configuration as per Creating+custom+reports guideline. You can use any of the options available for <clover-report> task in it.

3. In this custom report configuration define the <sourcepath> element for the <clover-report> tasks defined in "current" and "historical" targets.


Im trying to use command line tool to generate report as below:

java -Dclover.license.path=../resources/clover.license -classpath ../lib/clover-3.2.1.jar com.atlassian.clover.reporters.html.HtmlReporter -p ../lib -i clover-proj.db -o clover_html

But am getting these errors:

ERROR: Failed to render syntax highlights for <myserver/path/to/>: <myserver/path/to/>: (No such file or directory)

Looks like the path for java files is hardcoded ...I tried using "-p" option to point to location where the source code jars are present, but that doesn't work. We cannot generate report on server (where src code is present) there a way to get the syntax highlighting working in this case?

I tried using "-p" option to point to location where the source code jars are present

Please do not use JARs. Clover does not read sources from archives.

Instead of this, please point to a directory containing source files.

The team generating the report, have access only to

1. clover.db

2. coverage files

3. clover-3.2.1.jar and

4. clover.license.

They do not have source code in their environment.. what do we do now?

Use HtmlReporter with the '--hidesrc' option - it will not render source pages.

I was looking for source highlighting (which lines were hit and which did not), but I guess there is no way to do without access to source files. Anyways, thanks for the help.

Indeed. It would be hard to imagine how this could work without sources. Line numbers only? Rather impractical...

We tried giving the path to the .java source files using "-p" option . But report generation still looks for the files in the build path. For example:

While intrumenting if the files were at a/b/ Generate report with '-p x/y/'. But it fails saying cannot find '/a/b/' ..How do we overrite this?

Generate report with '-p x/y/'

You should not point to a source file, but to a root directory (or directories). For example, if during instrumentation sources were present in directories:



(e.g. /build/projectA/src/main/java/com/acme/

and during report generation these sources are in:



then you shall use:

HtmlReporter -p "/reporting/projectA/src/main/java:/reporting/projectA/src/test/java" ...

Note: use ":" for Linux and ";" for Windows.

I checked again and found that I used only paths and not exact file names.

Why is it still looking for sources in build path?

If Clover uses the original build path, then it means that it doesn't see sources under a path(s) provided by you. Are you sure that you're using correct source roots?

You can run Clover with debug logging (ant -d / mvn -X / HtmlReporter -d) and look for messages like:

"looking for /com/acme/ (FOUND|not found)"

"/com/acme/ not found on path"

Suggest an answer

Log in or Join to answer
Community showcase
Teodora [Botron]
Published Thursday in Marketplace Apps

Jira Inferno: The Nine Circles of Jira Administration Hell

If you spend enough time as a Jira admin - whether you are managing a single, mid-sized instance, a large enterprise one or juggling multiple instances at once - you will eventually find yourself in ...

381 views 1 13
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot