jacoco 0.7.9, sonar6.5, jenkins 2.6.1 New code coverage not shown in sonarqube

157 views
Skip to first unread message

zhuti...@gmail.com

unread,
Sep 22, 2017, 4:49:42 AM9/22/17
to SonarQube

 

hi,
   im not able to view new code coverage on sonar dashboard. what should i do ?thanks!
   param is:
sonar.projectKey=com.*.*:*
sonar.projectName= *
sonar.projectVersion=1.0
sonar.modules=**
sonar.language=java
sonar.sourceEncoding=UTF-8
sonar.sources=src/main/java
sonar.java.binaries=target/classes
sonar.tests=src/test/java
sonar.core.codeCoveragePlugin=jacoco
sonar.jacoco.reportPath=target/jacoco.exec
sonar.dynamicAnalysis=reuseReports
Message has been deleted

zhuti...@gmail.com

unread,
Sep 22, 2017, 5:37:42 AM9/22/17
to SonarQube
jenkins log:
INFO: JaCoCo report not found: 'target/jacoco.exec'
INFO: JaCoCo report not found: 'target/jacoco-it.exec'
INFO: JaCoCo UT report not found: 'vmp-web/target/jacoco.exec,vmp-rule/target/jacoco.exec'

how to config it?

在 2017年9月22日星期五 UTC+8下午4:49:42,zhuti...@gmail.com写道:

Michael Gumowski

unread,
Sep 22, 2017, 8:03:17 AM9/22/17
to zhuti...@gmail.com, SonarQube
Hello zhutingwei,

As documented in the documentation, you should use property "sonar.jacoco.reportPaths". 
Because, it seems to me that you are using the deprecated property "sonar.jacoco.reportPath". 

To prevent any misunderstanding, are you sure that you are correctly generating these reports prior to the analysis?
You have to manually generate them and feed them to the analyzer. No plugin is actually going to compute coverage for you.

I have no idea what property "sonar.core.codeCoveragePlugin" could be, but I'm almost sure it's not a property supported today.

Cheers,
Michael


--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/d3904b44-e970-4b0d-822e-439529924e04%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Michael Gumowski | SonarSource
Software Developer, Language Team
http://sonarsource.com

zhuti...@gmail.com

unread,
Sep 24, 2017, 10:46:40 PM9/24/17
to SonarQube
hi Michael Gumowski,
    Thank you for your reply, I got my mistake and corrected.
    But I got another error log.
my config:
sonar.projectKey=com.vdian.vmp:vmp
sonar.projectName= vmp
sonar.projectVersion=1.0
sonar.modules=vmp-web,vmp-rule,vmp-inventory,vmp-core,vmp-common,vmp-client,vmp-biz
sonar.language=java
sonar.sourceEncoding=UTF-8
sonar.sources=src/main/java
sonar.java.binaries=target/classes
sonar.tests=src/test/java
sonar.jacoco.reportPaths=/data5/jenkins/workspace/wd_vmp_unittest/vmp-core/target/jacoco.exec


INFO: Option -e/--errors is no longer supported and will be ignored
INFO: Scanner configuration file: /data5/jenkins/tools/hudson.plugins.sonar.SonarRunnerInstallation/SonarQube_Scanner/conf/sonar-scanner.properties
INFO: Project root configuration file: NONE
INFO: SonarQube Scanner 3.0.3.778
INFO: Java 1.8.0_111 Oracle Corporation (64-bit)
INFO: Linux 2.6.32-358.el6.x86_64 amd64
INFO: User cache: /home/www/.sonar/cache
INFO: Load global settings
INFO: Load global settings (done) | time=105ms
INFO: User cache: /home/www/.sonar/cache
INFO: Load plugins index
INFO: Load plugins index (done) | time=17ms
INFO: Plugin [l10nzh] defines 'l10nen' as base plugin. This metadata can be removed from manifest of l10n plugins since version 5.2.
INFO: SonarQube server 6.5.0
INFO: Default locale: "en_US", source code encoding: "UTF-8"

INFO: Quality profile for java: Sonar way
INFO: Sensor JavaSquidSensor [java]
INFO: Configured Java source version (sonar.java.source): none
INFO: JavaClasspath initialization
WARN: Bytecode of dependencies was not provided for analysis of source files, you might end up with less precise results. Bytecode can be provided using sonar.java.libraries property
INFO: JavaClasspath initialization (done) | time=0ms
INFO: JavaTestClasspath initialization
WARN: Bytecode of dependencies was not provided for analysis of test files, you might end up with less precise results. Bytecode can be provided using sonar.java.test.libraries property
INFO: JavaTestClasspath initialization (done) | time=1ms
INFO: Java Main Files AST scan
INFO: 550 source files to be analyzed
INFO: 88/550 files analyzed, current file: /home/www/jenkins/workspace/wd_vmp_unittest/vmp-core/src/main/java/com/vdian/vmp/core/manager/impl/VgRollbackHelper.java
INFO: 258/550 files analyzed, current file: /home/www/jenkins/workspace/wd_vmp_unittest/vmp-core/src/main/java/com/vdian/vmp/core/plan/callable/PresentCalPlanCallable.java
INFO: 294/550 files analyzed, current file: /home/www/jenkins/workspace/wd_vmp_unittest/vmp-core/src/main/java/com/vdian/vmp/core/plugin/impl/PluginGetImpl.java
INFO: 376/550 files analyzed, current file: /home/www/jenkins/workspace/wd_vmp_unittest/vmp-core/src/main/java/com/vdian/vmp/core/service/impl/combo/ComboServiceImpl.java
INFO: 430/550 files analyzed, current file: /home/www/jenkins/workspace/wd_vmp_unittest/vmp-core/src/main/java/com/vdian/vmp/core/service/impl/raffle/VddsBatchProcessHelper.java
INFO: 520/550 files analyzed, current file: /home/www/jenkins/workspace/wd_vmp_unittest/vmp-core/src/main/java/com/vdian/vmp/core/util/PromotionRequestConvert.java
INFO: 550/550 source files have been analyzed
WARN: Classes not found during the analysis : [com.alibaba.fastjson.JSONObject, com.koudai.fenxiao.client.model.FxCommissionData, com.koudai.vmp.VmpServiceResult, com.koudai.vmp.common.model.ShopCoupon, com.koudai.vmp.common.query.BuyerShopCouponQuery, com.koudai.vmp.common.vo.BuyerShopCouponVo, com.koudai.vmp.service.BuyerCouponReadService, com.koudai.vmp.service.BuyerCouponWriteService, com.koudai.vmp.service.SellerShopCouponReadService, com.koudai.vmp.service.SellerShopCouponWriteService, com.vdian.brandgo.client.model.BrandUserRelationResponse, com.vdian.brandgo.client.model.BrandUserRelationResponse$BrandUser, com.vdian.brandgo.client.model.BrandUserRelationResponse$BrandUserRelation, com.vdian.brandgo.client.query.BrandUserRelationRequest, com.vdian.redis.RedisPoolClient, com.vdian.sms.AlarmHelper, com.vdian.tcc.client.RemoteTccAutoProxyCreator, com.vdian.tm.client.service.TMInnerOrderReadService, com.vdian.tm.client.service.TMOrderWriteService, com.vdian.tm.common.model.TmCloseOrderDO, com.vdian.tm.common.model.TmFinishOrderDO, com.vdian.tm.common.model.TmOrderStatusChangeDO, com.vdian.tm.common.model.TmSystemRefundDO, com.vdian.trade.vpp.client.exception.PointException, com.vdian.trade.vpp.client.module.Buyer, com.vdian.trade.vpp.client.module.Item, com.vdian.trade.vpp.client.module.Seller, com.vdian.trade.vpp.client.module.UsedPointSpec, com.vdian.trade.vpp.client.module.VppSnapshot, com.vdian.trade.vpp.client.module.buy.PointUnionRequest, com.vdian.trade.vpp.client.module.buy.PointUnionResult, com.vdian.trade.vpp.client.module.buy.PointUnionUsedResult, com.vdian.trade.vpp.client.module.buy.ShopPointItemCluster, com.vdian.trade.vpp.client.service.BuyPointInvoke, com.vdian.usercenter.client.model.Response, com.vdian.usercenter.client.user.UserTagService, com.vdian.usercenter.client.vip.model.Privilege, com.vdian.usercenter.client.vip.model.VipPrivilege, com.vdian.usercenter.client.vip.service.VipQueryService, com.vdian.vbasic.client.model.CommonResult, com.vdian.vmp.biz.vgroupon.VGrouponService, com.vdian.vmp.client.service.PromotionWriteService, com.vdian.vmp.common.exception.InterruptCreateOrderException, com.vdian.vmp.common.exception.PromotionException, com.vdian.vmp.common.exception.VmpException, com.vdian.vmp.common.module.BuyerInfo, com.vdian.vmp.common.module.DealAfterCreateOrderFailRequest, com.vdian.vmp.common.module.DealAfterCreateOrderFailResponse, com.vdian.vmp.common.module.DealAfterPromotionRequest, com.vdian.vmp.common.module.ExecutorObject4AfterCreateOrder, ...]
INFO: Java Main Files AST scan (done) | time=64368ms
INFO: Java Test Files AST scan
INFO: 111 source files to be analyzed
INFO: Java Test Files AST scan (done) | time=2464ms
INFO: Sensor JavaSquidSensor [java] (done) | time=66849ms
INFO: Sensor SurefireSensor [java]
INFO: parsing [/home/www/jenkins/workspace/wd_vmp_unittest/vmp-core/target/surefire-reports]
INFO: 111/111 source files have been analyzed
INFO: Sensor SurefireSensor [java] (done) | time=71ms
INFO: Sensor JaCoCoSensor [java]
INFO: Analysing /data5/jenkins/workspace/wd_vmp_unittest/vmp-core/target/jacoco.exec
INFO: No information about coverage per test.

在 2017年9月22日星期五 UTC+8下午8:03:17,Michael Gumowski写道:

zhuti...@gmail.com

unread,
Sep 24, 2017, 11:43:52 PM9/24/17
to SonarQube
hi Michael Gumowski,
   I cannot got the result of New code coverage, I don't have any idea, what should i do? thank you!


在 2017年9月22日星期五 UTC+8下午4:49:42,zhuti...@gmail.com写道:

Nicolas Peru

unread,
Sep 25, 2017, 8:57:11 AM9/25/17
to zhuti...@gmail.com, SonarQube
Hi, 

First of all, which version of the java analyzer SonarJava are you using ? 

The Log line you mention about information about coverage per test just means you did not setup listeners to get information about which line is covered by which tests. This is not important for now as you want coverage information to be displayed first. 

So the first question to ask is : you generated a jacoco.exec file  : how did you generated it ? and are you sure you have the proper coverage in that exec file ? you could verify this by generating an html report from jacoco. If it is empty then you have a problem in your jacoco configuration and the problem has nothing to do with SonarQube.  ( see jacoco documentation for explanations on how to generate html report  : http://www.eclemma.org/jacoco/trunk/doc/report-mojo.html 
The information displayed in sonarqube can only be as good as what you have in your coverage report (the jacoco.exec file), so let's actually first check that you have the proper data in this report. 

Cheers, 


--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
--
Nicolas Peru | SonarSource
Reply all
Reply to author
Forward
0 new messages