SonarQube 4.3 - 0文件索引

时间:2014-06-18 08:15:38

标签: java code-coverage sonarqube sonar-runner

我正在尝试对我的jave代码进行声纳分析。没有索引的文件。

INFO: Runner configuration file: C:\Program Files\Development\Tools\sonar-runner-2.4\conf\sonar-runner.properties
INFO: Project configuration file: C:\Program Files\Development\Tools\sonar-runner-2.4\Projects\sonar-project.properties
INFO: Default locale: "en_US", source code encoding: "UTF-8"
INFO: Work directory: C:\Program Files\Development\Tools\sonar-runner-2.4\bin\.\.sonar
INFO: SonarQube Server 4.3
09:41:48.340 INFO  - Load batch settings
09:41:49.535 INFO  - User cache: C:\Users\z003bw5a\.sonar\cache
09:41:49.580 INFO  - Install plugins
09:41:55.230 INFO  - Install JDBC driver
09:41:55.272 INFO  - Create JDBC datasource for jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8
09:42:00.687 INFO  - Initializing Hibernate
09:42:15.950 INFO  - Load project settings
09:42:16.125 INFO  - Apply project exclusions
09:42:16.812 INFO  - -------------  Scan skuska 1
09:42:16.842 INFO  - Load module settings
09:42:20.400 INFO  - Language is forced to java
09:42:21.177 INFO  - Loading technical debt model...
09:42:21.241 INFO  - Loading technical debt model done: 64 ms
09:42:21.246 INFO  - Loading rules...
09:42:22.359 INFO  - Loading rules done: 1113 ms
09:42:22.430 INFO  - Configure Maven plugins
09:42:22.730 INFO  - Compare to previous analysis (2014-06-18)
09:42:22.767 INFO  - Compare over 30 days (2014-05-19, analysis of 2014-06-18 09:12:14.0)
09:42:22.926 INFO  - Loaded quality gate 'SonarQube way'
09:42:24.118 INFO  - Base dir: C:\Program Files\Development\Tools\sonar-runner-2.4\bin\.
09:42:24.122 INFO  - Working dir: C:\Program Files\Development\Tools\sonar-runner-2.4\bin\.\.sonar
09:42:24.126 INFO  - Source encoding: UTF-8, default locale: en_US
09:42:24.137 INFO  - Index files
09:42:24.228 INFO  - 0 files indexed
09:42:24.238 INFO  - Quality profile for java: Sonar way
09:42:24.254 INFO  - JaCoCo report not found.
09:42:24.269 INFO  - JaCoCo IT report not found.
09:42:24.274 INFO  - JaCoCo reports not found.
09:42:24.328 INFO  - Sensor QProfileSensor...
09:42:24.454 INFO  - Sensor QProfileSensor done: 126 ms
09:42:24.458 INFO  - Sensor InitialOpenIssuesSensor...
09:42:24.493 INFO  - Sensor InitialOpenIssuesSensor done: 35 ms
09:42:24.498 INFO  - Sensor ProfileEventsSensor...
09:42:24.581 INFO  - Sensor ProfileEventsSensor done: 83 ms
09:42:24.585 INFO  - Sensor ProjectLinksSensor...
09:42:24.612 INFO  - Sensor ProjectLinksSensor done: 27 ms
09:42:24.615 INFO  - Sensor VersionEventsSensor...
09:42:24.886 INFO  - Sensor VersionEventsSensor done: 271 ms
09:42:24.890 INFO  - Sensor FileHashSensor...
09:42:24.894 INFO  - Sensor FileHashSensor done: 4 ms
09:42:24.905 INFO  - Sensor CpdSensor...
09:42:24.908 INFO  - SonarEngine is used for java
09:42:24.919 INFO  - Sensor CpdSensor done: 14 ms
09:42:26.614 INFO  - Execute decorators...
09:42:27.719 INFO  - Store results in database
09:42:28.073 INFO  - ANALYSIS SUCCESSFUL, you can browse http://localhost:9000/dashboard/index/skuska
09:42:28.629 INFO  - Executing post-job class org.sonar.plugins.dbcleaner.ProjectPurgePostJob
09:42:28.739 INFO  - -> Keep one snapshot per day between 2014-05-21 and 2014-06-17
09:42:28.753 INFO  - -> Keep one snapshot per week between 2013-06-19 and 2014-05-21
09:42:28.781 INFO  - -> Keep one snapshot per month between 2009-06-24 and 2013-06-19
09:42:28.785 INFO  - -> Delete data prior to: 2009-06-24
09:42:28.856 INFO  - -> Clean skuska 1 [id=3]
09:42:28.905 INFO  - <- Clean snapshot 19
09:42:29.430 INFO  - Executing post-job class org.sonar.plugins.core.issue.notification.SendIssueNotificationsPostJob
09:42:29.435 INFO  - Executing post-job class org.sonar.plugins.core.batch.IndexProjectPostJob
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
Total time: 56.892s
Final Memory: 11M/212M
INFO: ------------------------------------------------------------------------

我的声纳设置如下:

# Section 1: required metadata
sonar.projectKey=skuska
sonar.projectName=skuska 1
sonar.projectVersion=0.1    

# Section 2: project directories
# path to source directories (required)
sonar.sources=C:\Program Files\Development\Tools\sonar-runner-2.4\Projects\skuska

# path to test source directories (optional)
#sonar.tests=   

# path to project binaries (optional), for example directory of Java
# bytecode
#sonar.binaries=    

# Section 3: Java and libraries settings
# optional comma-separated list of paths to libraries. Only path to JAR file
# and path to directory of classes are supported.
#libraries=path/to/library.jar
# Uncomment those lines if some features of java 5 or java 6 like
# annotations, enum, ...
# are used in the source code to be analysed
#sonar.java.source=1.5
#sonar.java.target=1.5    

# Section 4: Advanced parameters
# Uncomment this line to analyse a project which is not a java project.
# The value of the property must be the key of the language.
sonar.language=java
# Advanced parameters
#sonar.my.property=value    
sonar.sourceEncoding=UTF-8

分析成功,但Web服务器只是项目的名称,没有关于指标和代码覆盖率的数据。

请帮助我!

1 个答案:

答案 0 :(得分:2)

正如您在the documentation中所读到的那样,您应该将sonar-project.properties文件放在项目的根目录并从该文件夹启动分析,从而替换&#34; sonar.sources&# 34;具有相对路径而不是绝对路径的属性。