java - Class not found error when running sonarrunner -
i getting class not found error. the class not accessible through class loader , error being prompt when running sonarrunner gradle.
these classes included dependencies in compile time in gradle , gradle build works fine. how include these classes sonar ?
14:53:24.322 info - load module settings 14:53:24.335 info - base dir: /users/srao1/documents/gradletest/lds_warehouse/lds_warehouse_base 14:53:24.335 info - working dir: /users/srao1/documents/gradletest/lds_warehouse/build/sonar/lds_warehouse_lds_warehouse_base 14:53:24.336 info - source paths: src 14:53:24.336 info - test paths: test 14:53:24.336 info - binary dirs: build/classes/main 14:53:24.336 info - source encoding: utf-8, default locale: en_us 14:53:24.336 info - index files 14:53:24.444 info - 50 files indexed 14:53:24.593 info - quality profile java: sonar way 14:53:24.604 info - sensor javasquidsensor 14:53:24.620 warn - sonar.binaries , sonar.libraries deprecated since version 2.5 of sonar-java-plugin, please use sonar.java.binaries , sonar.java.libraries instead 14:53:24.628 info - java main files ast scan... 14:53:24.628 info - 45 source files analyzed 14:53:25.070 error - class not found: com.lim.dw.dao.base.bean.warehousefeed 14:53:25.070 error - class not found: com.lim.dw.dao.base.bean.phasetimer 14:53:32.459 warn - class 'com/lim/lds/ldsdatafeed' not accessible through classloader. 14:53:32.459 warn - class 'com/lim/lds/ldsdatafeed' not accessible through classloader. 14:53:32.459 warn - class 'com/lim/logger/logger' not accessible through classloader. 14:53:32.459 warn - class 'com/lim/logger/logger' not accessible through classloader. 14:53:32.477 info - java bytecode scan done: 162 ms 14:53:32.477 info - java test files ast scan... 14:53:32.477 info - 5 source files analyzed 14:53:32.727 info - java test files ast scan done: 250 ms 14:53:32.728 info - 5/5 source files have been analyzed 14:53:32.728 info - package design analysis... 14:53:32.800 info - package design analysis done: 72 ms 14:53:32.889 info - sensor javasquidsensor (done) | time=8285ms 14:53:32.889 info - sensor lines sensor 14:53:32.892 info - sensor lines sensor (done) | time=3ms 14:53:32.892 info - sensor qprofilesensor 14:53:32.894 info - sensor qprofilesensor (done) | time=2ms 14:53:32.904 info - sensor initialopenissuessensor 14:53:33.016 info - sensor initialopenissuessensor (done) | time=112ms 14:53:33.016 info - sensor projectlinkssensor 14:53:33.018 info - sensor projectlinkssensor (done) | time=2ms 14:53:33.018 info - sensor versioneventssensor 14:53:33.023 info - sensor versioneventssensor (done) | time=5ms 14:53:33.023 info - sensor surefiresensor 14:53:33.023 info - parsing /users/srao1/documents/gradletest/lds_warehouse/lds_warehouse_base/target/surefire-reports 14:53:33.023 error - reports path not found or not directory: /users/srao1/documents/gradletest/lds_warehouse/lds_warehouse_base/target/surefire-reports 14:53:33.023 info - sensor surefiresensor (done) | time=0ms 14:53:33.023 info - sensor jacocooverallsensor 14:53:33.037 warn - not using latest jacoco binary format version, please consider upgrading latest jacoco version. 14:53:33.037 info - analysing /users/srao1/documents/gradletest/lds_warehouse/lds_warehouse_base/build/jacoco/jacocotest.exec 14:53:33.072 warn - not using latest jacoco binary format version, please consider upgrading latest jacoco version. 14:53:33.072 info - analysing /users/srao1/documents/gradletest/lds_warehouse/build/sonar/lds_warehouse_lds_warehouse_base/jacoco-overall.exec 14:53:33.234 info - no information coverage per test. 14:53:33.234 info - sensor jacocooverallsensor (done) | time=211ms 14:53:33.234 info - sensor scm sensor 14:53:33.234 info - no scm system detected. can use 'sonar.scm.provider' property explicitly specify it. 14:53:33.234 info - sensor scm sensor (done) | time=0ms 14:53:33.234 info - sensor jacocosensor 14:53:33.236 warn - not using latest jacoco binary format version, please consider upgrading latest jacoco version. 14:53:33.236 info - analysing /users/srao1/documents/gradletest/lds_warehouse/lds_warehouse_base/build/jacoco/jacocotest.exec 14:53:33.306 info - no information coverage per test. 14:53:33.306 info - sensor jacocosensor (done) | time=72ms 14:53:33.306 info - sensor cpd sensor 14:53:33.306 info - javacpdengine used java 14:53:33.307 info - cross-project analysis disabled 14:53:33.545 info - sensor cpd sensor (done) | time=239ms 14:53:33.546 info - no quality gate configured. 14:53:33.549 info - compare previous analysis (2015-07-23) 14:53:33.550 info - compare on 30 days (2015-06-24, analysis of wed jul 22 16:29:23 cdt 2015) 14:53:33.716 info - execute decorators...
to perform source code analysis sq java plugin needs bytecode in addition source code. bytecode location source files provided properties sonar.java.binaries
, sonar.java.test.binaries
. bytecode (or jar) locations third party libs provided properties sonar.java.libraries
, sonar.java.test.libraries
.
if don't provide correctly properties you'll see 'class not found' errors. doesn't prevent complete analysis many sq java rules not work , not detect issue.
(partial) example: sonar-runner -dsonar.sources=src -dsonar.java.binaries=bin/classes -dsonar.java.libraries=libs/*.jar
Comments
Post a Comment