Source File link is missing

249 views
Skip to first unread message

sune...@gmail.com

unread,
Feb 24, 2016, 6:30:21 AM2/24/16
to JaCoCo and EclEmma Users
Hi,
Using jacoco to generate report.
Report getting generated .
But no link is coming for Source files.

Please find the below source code for report

task testJacocoReport(type: JacocoReport){

sourceDirectories = fileTree(dir: "$aps_home/src", exclude: 'test/**/*.java')
classDirectories = fileTree(dir: "$buildDir", exclude: 'test-classes/**/*.class')
executionData files("$aps_home/build/jacoco/jacoco.exec")
def reportDir = "build/jacocoReport"
reports {
xml{
enabled true
destination "$aps_home/build/jacoco.xml"
}
csv{
enabled true
destination "$aps_home/build/jacoco.csv"
}
html.destination = reportDir
}
doLast {
println "Jacoco report for client created: file://${reportDir.toURI().path}"
}
}


Please let me know where I am missing .
Regards
SS

Marc R. Hoffmann

unread,
Feb 24, 2016, 12:30:20 PM2/24/16
to jac...@googlegroups.com
Hi,

there are two common problems:

1) Missing debug information: Your class files needs to be compiled with
debug information. You check in the JaCoCo report whether line coverage
is reported in the tables.

2) The source files must be properly provided starting from the Java
package root. In your case the package root seems to be more likely
$aps_home/src/test, maybe even $aps_home/src/test/java

Regards,
-marc

sune...@gmail.com

unread,
Feb 25, 2016, 12:43:24 AM2/25/16
to JaCoCo and EclEmma Users

Thanks Marc,
In my html I am getting Line Covered Column also.
I am using Mockito framework for unit testing and getting warning also like "execution data not matching with runtime class files"
is this is the reason for not showing source file links.

Please help me how to handle this warning and get the source file link.

Thanks

sune...@gmail.com

unread,
Feb 25, 2016, 3:58:15 AM2/25/16
to JaCoCo and EclEmma Users, sune...@gmail.com
Inside src folder I have different modules like
src ---
--- module1
----com (packages start)
----module2
------com(packages start)
-----test(test folder)
-----module1
-----java
------com(package)

Marc R. Hoffmann

unread,
Feb 25, 2016, 5:04:37 PM2/25/16
to jac...@googlegroups.com
Ok, this is the problem. So you need to specify source files rooted on
module level.

Regards,
-marc

sune...@gmail.com

unread,
Mar 7, 2016, 2:23:39 AM3/7/16
to JaCoCo and EclEmma Users

Thanks Marc,

Now I got source file link,
if src directory is wrong ,link wont work,so for source file link src directory should be correct directory.

Regards,
Suneetika

Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages