首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >不推荐使用SonarQube构建后操作。

不推荐使用SonarQube构建后操作。
EN

Stack Overflow用户
提问于 2016-09-28 14:28:45
回答 1查看 8.9K关注 0票数 5

使用Jenkins 1.642.2对我的所有maven项目进行代码分析,并使用SonarQube 5.6.1。

当我使用maven目标声纳:声纳时,它们需要更多的时间来分析文件(文件超过7秒):

代码语言:javascript
复制
[INFO] Sensor SCM Sensor
[INFO] SCM provider for this project is: svn
[INFO] 1079 files to be analyzed
[INFO] 
[INFO] 2/1079 files analyzed
[INFO] 3/1079 files analyzed
[INFO] 4/1079 files analyzed
[INFO] 5/1079 files analyzed

当我在此配置中使用SonarQube扫描程序时:

那么我就有了这个错误:

代码语言:javascript
复制
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

我的设置文件:

代码语言:javascript
复制
<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>

有什么办法解决这个问题,因为我有一个问题要理解新的声纳使用

我必须为maven项目制作一个声纳-project.properties文件?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-09-28 14:39:24

您可以并且仍然应该使用构建步骤使用Maven进行分析。正如所述的在医生里,您应该首先在全局配置级别“启用SonarQube服务器配置”,然后在构建启用构建环境选项“准备SonarQube扫描仪环境”中。然后,您可以将Maven目标设置为:

代码语言:javascript
复制
$SONAR_MAVEN_GOAL -Dsonar.host.url=$SONAR_HOST_URL -Dsonar.login=$SONAR_AUTH_TOKEN
票数 10
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/39750436

复制
相关文章

相似问题

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