首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Sonar-Runner不索引任何文件

Sonar-Runner不索引任何文件
EN

Stack Overflow用户
提问于 2014-05-09 22:27:44
回答 2查看 16.9K关注 0票数 8

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

代码语言:javascript
复制
me@fhnw:/home/mycomp/myReporting/sonar-runner/java-sonar-runner-simple$ /home/me/tmp/sonar-runner-2.4/bin/sonar-runner 
SonarQube Runner 2.4
Java 1.7.0_55 Oracle Corporation (64-bit)
Linux 3.5.0-49-generic amd64
INFO: Runner configuration file: /home/me/tmp/sonar-runner-2.4/conf/sonar-runner.properties
INFO: Project configuration file: /home/mycomp/myReporting/sonar-runner/java-sonar-runner-simple/sonar-project.properties
INFO: Default locale: "en_US", source code encoding: "UTF-8"
INFO: Work directory: /home/mycomp/myReporting/sonar-runner/java-sonar-runner-simple/./.sonar
INFO: SonarQube Server 4.2
16:15:45.869 INFO  - Load batch settings
16:15:46.002 INFO  - User cache: /home/me/.sonar/cache
16:15:46.009 INFO  - Install plugins
16:15:46.120 INFO  - Install JDBC driver
16:15:46.127 WARN  - H2 database should be used for evaluation purpose only
16:15:46.127 INFO  - Create JDBC datasource for jdbc:h2:tcp://localhost/sonar
16:15:47.170 INFO  - Initializing Hibernate
16:15:48.391 WARN  - /!\ The 'tests' property is deprecated and is replaced by 'sonar.tests'. Don't forget to update your files.
16:15:48.391 WARN  - /!\ The 'binaries' property is deprecated and is replaced by 'sonar.binaries'. Don't forget to update your files.
16:15:48.954 INFO  - Load project settings
16:15:49.003 INFO  - Apply project exclusions
16:15:49.148 INFO  - -------------  Scan My project
16:15:49.152 INFO  - Load module settings
16:15:49.719 INFO  - Language is forced to java
16:15:49.739 INFO  - Loading technical debt model...
16:15:50.109 INFO  - Loading technical debt model done: 370 ms
16:15:50.120 INFO  - Configure Maven plugins
16:15:50.303 INFO  - Compare to previous analysis (2014-05-09)
16:15:50.328 INFO  - Compare over 30 days (2014-04-09, analysis of 2014-05-07 13:39:57.555)
16:15:50.480 INFO  - Base dir: /home/mycomp/myReporting/sonar-runner/java-sonar-runner-simple/.
16:15:50.480 INFO  - Working dir: /home/mycomp/myReporting/sonar-runner/java-sonar-runner-simple/./.sonar
16:15:50.480 INFO  - Source dirs: /home/mycomp/myReporting/app
16:15:50.480 INFO  - Test dirs: /home/mycomp/myReporting/test
16:15:50.480 INFO  - Binary dirs: /home/mycomp/myReporting/target/scala-2.10/classes
16:15:50.480 INFO  - Source encoding: UTF-8, default locale: en_US
16:15:50.480 INFO  - Index files
16:15:50.516 WARN  - File '%s' is ignored. It is not located in module basedir '%s'.
...
16:15:50.539 WARN  - File '%s' is ignored. It is not located in module basedir '%s'.
16:15:50.539 INFO  - 0 files indexed
16:15:50.541 INFO  - Quality profile for java: Sonar way
16:15:50.549 INFO  - Sensor Quality gate loader...
16:15:50.550 INFO  - Sensor Quality gate loader done: 1 ms
16:15:50.550 INFO  - Sensor QProfileSensor...
16:15:50.555 INFO  - Sensor QProfileSensor done: 5 ms
16:15:50.556 INFO  - Sensor CpdSensor...
16:15:50.556 INFO  - SonarEngine is used for java
16:15:50.556 INFO  - Sensor CpdSensor done: 0 ms
16:15:50.556 INFO  - Sensor InitialOpenIssuesSensor...
16:15:50.565 INFO  - Sensor InitialOpenIssuesSensor done: 9 ms
16:15:50.565 INFO  - Sensor ProfileEventsSensor...
16:15:50.590 INFO  - Sensor ProfileEventsSensor done: 25 ms
16:15:50.590 INFO  - Sensor ProjectLinksSensor...
16:15:50.595 INFO  - Sensor ProjectLinksSensor done: 5 ms
16:15:50.595 INFO  - Sensor VersionEventsSensor...
16:15:50.605 INFO  - Sensor VersionEventsSensor done: 10 ms
16:15:50.606 INFO  - Sensor FileHashSensor...
16:15:50.606 INFO  - Sensor FileHashSensor done: 0 ms
16:15:51.086 INFO  - Execute decorators...
16:15:51.272 INFO  - Store results in database
16:15:51.321 INFO  - ANALYSIS SUCCESSFUL, you can browse http://localhost:9000/dashboard/index/my:project
16:15:51.376 INFO  - Executing post-job class org.sonar.plugins.core.issue.notification.SendIssueNotificationsPostJob
16:15:51.377 INFO  - Executing post-job class org.sonar.plugins.core.batch.IndexProjectPostJob
16:15:51.398 INFO  - Executing post-job class org.sonar.plugins.dbcleaner.ProjectPurgePostJob
16:15:51.414 INFO  - -> Keep one snapshot per day between 2014-04-11 and 2014-05-08
16:15:51.415 INFO  - -> Keep one snapshot per week between 2013-05-10 and 2014-04-11
16:15:51.416 INFO  - -> Keep one snapshot per month between 2009-05-15 and 2013-05-10
16:15:51.417 INFO  - -> Delete data prior to: 2009-05-15
16:15:51.424 INFO  - -> Clean My project [id=2]
16:15:51.428 INFO  - <- Clean snapshot 9
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
Total time: 6.309s
Final Memory: 14M/498M
INFO: ------------------------------------------------------------------------

我正在使用jacoco进行代码覆盖。我的声纳设置如下:

代码语言:javascript
复制
# Required metadata
sonar.projectKey=my:project
sonar.projectName=My project
sonar.projectVersion=1.0

# Language
sonar.language=java

# Path to the parent source code directory.
# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
# Since SonarQube 4.2, this property is optional. If not set, SonarQube starts looking for source code
# from the directory containing the sonar-project.properties file.
sonar.sources=/home/mycomp/myReporting/app/
tests=/home/mycomp/myReporting/test/
binaries=/home/mycomp/myReporting/target/scala-2.10/classes

# Encoding of the source code
sonar.sourceEncoding=UTF-8

# Additional parameters
sonar.dynamicAnalysis=reuseReports
sonar.java.coveragePlugin=jacoco
sonar.jacoco.reportPath=/home/mycomp/myReporting/target/coverage/jacoco.exec

任何帮助都是非常感谢的。谢谢!

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2014-05-10 05:04:24

您必须从源目录的父目录中启动sonar-runner命令。这里不是这种情况,这就是为什么没有索引的原因。

票数 17
EN

Stack Overflow用户

发布于 2019-10-03 04:19:58

按照https://stackoverflow.com/a/23708680/1235394中的建议指定sonar.projectBaseDir属性

票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/23567128

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档