Jenkins SonarQube生成后操作已弃用
使用Jenkins 1.642.2进行代码分析,所有maven项目使用SonarQube 5.6.1进行代码分析 当我使用maven goal sonar:sonar时,他们需要更多的时间来分析文件(每个文件超过7秒): 当我将SonarQube扫描仪与此配置一起使用时: 那么我有一个错误:Jenkins SonarQube生成后操作已弃用,jenkins,java-8,sonarqube,maven-3,sonarqube-scan,Jenkins,Java 8,Sonarqube,Maven 3,Sonarqube Scan,使用Jenkins 1.642.2进行代码分析,所有maven项目使用SonarQube 5.6.1进行代码分析 当我使用maven goal sonar:sonar时,他们需要更多的时间来分析文件(每个文件超过7秒): 当我将SonarQube扫描仪与此配置一起使用时: 那么我有一个错误: WARN: Property 'sonar.jdbc.url' is not supported any more. It will be ignored. There is no longer a
WARN: Property 'sonar.jdbc.url' is not supported any more. It will be ignored. There is no longer any DB connection to the SQ database.
WARN: Property 'sonar.jdbc.username' is not supported any more. It will be ignored. There is no longer any DB connection to the SQ database.
WARN: Property 'sonar.jdbc.password' is not supported any more. It will be ignored. There is no longer any DB connection to the SQ database.
INFO: User cache: /var/lib/jenkins/.sonar/cache
INFO: Load plugins index
INFO: Load plugins index (done) | time=43ms
INFO: SonarQube server 5.6.1
INFO: Default locale: "en_US", source code encoding: "UTF-8" (analysis is platform dependent)
INFO: Process project properties
INFO: ---------------------------------------------------------------------- --
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 1.621s
INFO: Final Memory: 39M/132M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarQube Scanner execution
ERROR: You must define the following mandatory properties for 'Unknown': sonar.projectKey, sonar.projectName, sonar.projectVersion, sonar.sources
ERROR:
ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
Build step 'Execute SonarQube Scanner' marked build as failure
Finished: FAILURE
我的设置文件:
<profile>
<id>sonar</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<sonar.jdbc.url>
jdbc:mysql://11.230.5.88:3306/sonar
</sonar.jdbc.url>
<sonar.jdbc.username>sonar</sonar.jdbc.username>
<sonar.jdbc.password>sonar</sonar.jdbc.password>
<!-- Optional URL to server. Default value is http://localhost:9000 -->
<sonar.host.url>
http://sonarqube-groupe.com/
</sonar.host.url>
</properties>
</profile>
声纳
真的
jdbc:mysql://11.230.5.88:3306/sonar
声纳
声纳
http://sonarqube-groupe.com/
有没有解决这个问题的办法,因为我在理解新的声纳的使用方面有问题
我必须为maven项目创建一个sonar-project.properties文件?您可以也应该使用构建步骤使用maven进行分析。如上所述,您应该首先在全局配置级别“启用SonarQube服务器配置注入”,然后在构建中启用构建环境选项“准备SonarQube扫描程序环境”。然后,您可以将Maven目标设置为:
$SONAR_MAVEN_GOAL -Dsonar.host.url=$SONAR_HOST_URL -Dsonar.login=$SONAR_AUTH_TOKEN
现在还可以,但我在分析过程中仍然存在速度慢的问题!!与sonarqube的新版本有关吗?[INFO]本项目的SCM供应商为:svn[INFO]1079待分析文件[INFO][INFO]2/1079已分析文件[INFO]3/1079已分析文件[INFO]4/1079已分析文件[INFO]5/1079已分析文件[INFO]6/1079已分析文件[INFO]7/1079已分析文件[INFO]8/1079已分析文件[INFO]9/1079已分析文件[INFO]10/1079已分析文件[INFO]11/1079文件分析[INFO]13/1079文件分析有什么想法吗?我花了很长时间才意识到为什么我的作业没有这样一个“准备SonarQube扫描仪环境”。只有在标记“启用SonarQube服务器配置作为构建环境变量的注入”时,才会显示该标记是在全局Jenkins配置中设置的!谢谢@dokaspar。我已经扩展了答案,将其包括在内。
$SONAR_MAVEN_GOAL -Dsonar.host.url=$SONAR_HOST_URL -Dsonar.login=$SONAR_AUTH_TOKEN