java - Sonar 管 : "Project configuration file: NONE "

标签 java maven sonarqube sonar-runner sonarqube5.1

我已经配置了一切以对 Maven 项目进行 Sonar 分析。一切正常,直到我运行 sonar-runner :

     Max$ sonar-runner
     INFO: Scanner configuration file: /Users/Max/Documents/sonar-scanner-2.5/conf/sonar-runner.properties
     INFO: Project configuration file: NONE
     INFO: SonarQube Scanner 2.5
     INFO: Java 1.7.0_45 Oracle Corporation (64-bit)
     INFO: Mac OS X 10.10.3 x86_64
     INFO: User cache: /Users/Max/.sonar/cache
     INFO: Load global repositories
     INFO: Load global repositories (done) | time=143ms
     INFO: Property 'sonar.jdbc.url' is not supported any more. It will be ignored. There is no longer any DB connection to the SQ database.
     INFO: User cache: /Users/Max/.sonar/cache
     INFO: Load plugins index
     INFO: Load plugins index (done) | time=4ms
     INFO: Default locale: "fr_FR", source code encoding: "UTF-8" (analysis  is platform dependent)
     INFO: Process project properties
     INFO: ------------------------------------------------------------------------
     INFO: EXECUTION FAILURE
     INFO: ------------------------------------------------------------------------
     INFO: Total time: 1.631s
     INFO: Final Memory: 40M/194M
     INFO: ------------------------------------------------------------------------
     ERROR: Error during SonarQube Scanner execution
     ERROR: Unable to load component class org.sonar.batch.scan.ProjectLock
     ERROR: Caused by: Unable to load component class     org.sonar.api.batch.bootstrap.ProjectReactor
     ERROR: Caused by: You must define the following mandatory properties for 'Unknown': sonar.projectKey, sonar.projectName, sonar.projectVersion, sonar.sources
     ERROR: 
     ERROR: To see the full stack trace of the errors, re-run SonarQube  Scanner with the -e switch.
     ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
  • 我正在我的 java 项目文件夹中运行 sonar-runner
  • 我已经在我的 java 项目中放置并配置了 sonar-runner.properties

    sonar.projectKey=SeleniumMaven:sonar
    sonar.projectName=SeleniumMaven
    sonar.projectVersion=1.0
    sonar.sources=src
    sonar.sourceEncoding=UTF-8
    sonar.language=java
    

有什么想法吗?

最佳答案

我遇到了同样的问题,我意识到我的文件名不正确:我将其命名为“sonar-project.properties.properties”而不是“sonar-project.properties”。

我会尝试将您的文件名更改为“sonar-project.properties”并尝试...

关于java - Sonar 管 : "Project configuration file: NONE ",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35314553/

相关文章:

git - Maven Release Plugin 在 Jenkins Pipeline 中的使用

java - 在ant中设置SonarQube的JDK路径

java - Sonar 显示 DTO 类私有(private)字段存在问题

java - 如何使用 AsciiDoclet 从 .java 文件中的 javadoc 注释生成 asciidoc 文件

java - 无法使用 Java 启动 Spark

java - SimpleDateFormat() 在传递无效日期格式时不会给出 IllegalArgumentException

maven - 找不到记录器的附加程序(org.springframework.web.context.ContextLoader)

java - 使用 Linux 命令行运行 Java Maven 项目

java - JDBC中如何调用存储过程

mysql - 启动tomcat时 Sonar SQLException