maven


Jacoco code coverage with Sonar and maven for integration tests in separate module


I've configured my project with SonarQube and Jacoco for code coverage. Everything works well except one thing. I divided project in many maven sub modules:
project (pom.xml) -
|-moduleA (no pom here)
| |- it (pom.xml) - integration tests for "impl" module
| |- impl (pom.xml) - implementaion + Unit tests
|-moduelB
| |- it (pom.xml) - integration tests for "impl" module
| |- impl (pom.xml) - implementaion + Unit tests
|-moduleC ...
I start build using following command:
mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent -Dmaven.compiler.debug=true install sonar:sonar
The problem is that Jacoco can easily support Unit test coverage inside the same module (so in my case Unit Tests inside impl module) but cannot analyze coverage from it module which itself does not contain any implementation classes. It just contains integration tests for impl module. It's clear for me why it doesn't work. I'm getting such info in Jacoco logs:
No JaCoCo analysis of project coverage can be done since there is no class files.
After I've defined sonar.java.binaries property inside moduleA/it/pom.xml like this:
<properties>
<sonar.java.binaries>../impl/target/classes</sonar.java.binaries>
</properties>
coverage analysis of it still fails, but message in Jacoco logs changes to:
[INFO] Analysing D:\project\moduleA\it\target\jacoco.exec
[WARNING] Coverage information was not collected. Perhaps you forget to include debug information into compiled classes?
I must mention that D:\project\moduleA\it\target\jacoco.exec file exists. I also checked that compiled classes in D:\project\moduleA\impl\target\classes contain debug data (all lines, vars and source).
I was trying with different paths inside sonar.java.binaries but result is always the same. I've tried:
../impl/target/classes
../../impl/target/classes
../../../impl/target/classes
../impl/target
...
How can I configure Jacoco (Sonar) to allow it to find classes binaries in different maven sub module related to jacoco.exec file?
How did you specify the location of the jacoco.exec files? This should give you a clue on what is the path start for the bin-files as well.
I am using both sonar.binaries as sonar.java.binaries
(Running sonar6.2)

Related Links

Error in running a spring batch war file
gradle download all dependencies from maven repo
phantomjs-maven-plugin : error Could not find a suitable constructor
Where to add Maven dependencies in a multi-module Vaadin project in NetBeans 8?
SBT unresolved dependency: com.paypal.sdk#paypal-core;LATEST
Expected GPG user ID for Maven Central artifacts?
Maven release from a branch by jenkins
how can i use elasticsearch 2.2.1 with apache camel
Maven and Jenkins - 'mvn' is not recognized as an internal or external command,
Automate Version Name in Install4j
Why does Maven not use my privatekey when deploying with scp?
Maven copy jars from network location
Goal specific javax.net.ssl.trustStore
Issue while creating eclipse p2 repository using maven tycho plugin
How to add Apache Maven to PATH permanently
find path to JAX-RS resource

Categories

HOME
ms-access
pandas
multithreading
osgi
iot
programming-languages
filtering
jsrender
electronics
c#-2.0
sql-server-2016
google-project-tango
mvvmcross
in-app-purchase
qore
session-variables
here-api
gz
percona
quartz-scheduler
opentracing
tostring
google-cloud-speech
predix
swiftlint
visjs
scriptcs
facebook-instant-articles
excel-2007
extjs5
devops
trading
spark-jobserver
apache-commons-io
intel-pin
fifo
neo4j-spatial
http-status-code-503
karaf
lxd
mmenu
environment-modules
picasso
http-digest
file-format
bitbucket-pipelines
libraries
abstract-class
objectlistview
c11
awt
sas-visual-analytics
ensembles
dynamic-reports
wso2carbon
logfiles
outlook-2013
parentheses
revapi
atomicity
sage-one
togetherjs
yii2-extension
lowpass-filter
tactic
python-cryptography
imanage
specrun
static-ip-address
color-picker
radtreelist
persist
pagedlist
testng-dataprovider
pickadate
captivenetwork
apachebench
livequery
wapiti
freelancer.com-api
unity-networking
srand
wso2cloud
ruby-2.2
fouc
angular-leaflet-directive
web-controls
lustre
codeigniter-url
network-interface
gulp-less
p4java
valuechangelistener
poller
picturefill
meteor-velocity
flexmojos
ms-project-server-2010
ftps
tws
html-editor
flashvars
factory-method
first-responder
dbproviderfactories
online-compilation
nsmanagedobject
netbeans-6.9
transactionscope
nsdatecomponents
deobfuscation
cinema-4d
xfbml
subviews
brewmp
mtj
nerddinner
genealogy
dbisam

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App