Sonar-Runner 与本地数据库对话 [英] Sonar-Runner talks to the local database
问题描述
我正在尝试了解声纳运行器 http:///docs.sonarqube.org/display/SONAR/Installing+and+Configuring+SonarQube+Runner.我有一个中央声纳服务器,在同一主机上有一个数据库.正如预期的那样,我在许多盒子中从我的客户那里运行 sonar-runner,并希望他们将数据上传到声纳立方体.
I am trying to understand the sonar-runner http://docs.sonarqube.org/display/SONAR/Installing+and+Configuring+SonarQube+Runner. I have a central sonar server that has a database in the same host. As expected I run the sonar-runner from my clients in numerous boxes and expect them to upload data to the sonar cube.
我的 sonar-project.properties 如下所示
My sonar-project.properties looks something like below
# Required metadata
sonar.projectKey=a:b
sonar.projectName=b-1.0
sonar.projectVersion=1.0
# Comma-separated paths to directories with sources (required)
sonar.sources=lib
# Language
sonar.language=py
# Encoding of the source files
sonar.sourceEncoding=UTF-8
# Host of the sonar url
sonar.host.url=http://myserver:9000/msde/sonar/webapp
我希望我的客户端会执行一些分析,并使用一些用于上传的 Web 服务将数据直接上传到服务器.但是,我在日志中看到以下内容
I was expecting that my client would perform some analysis and upload data directly to the server using some web services meant for upload. I however see the following in my logs
10:42:00.678 INFO - Apply project exclusions
10:42:00.682 WARN - H2 database should be used for evaluation purpose only
10:42:00.682 INFO - Create JDBC datasource for jdbc:h2:tcp://localhost/sonar
10:42:00.755 INFO - Initializing Hibernate
问题
- 我应该在 sonar-project.properties 中配置数据库的详细信息吗?我期待它使用声纳 url 中的一些 web 服务来上传指标,但是暴露数据库细节有几个问题.我希望数据库位于服务器内部,并且不被各种客户端访问.
- 这也意味着我应该将数据库详细信息放在多个项目的各种属性文件中,因此更改中央数据库详细信息的成本是巨大的.
推荐答案
您需要编辑 $SONARQUBE_RUNNER_HOME/conf/sonar-runner.properties 文件以指向正确的数据库实例.这是您对所有项目都需要这样做的唯一文件.
You need to edit the $SONARQUBE_RUNNER_HOME/conf/sonar-runner.properties file to point to the correct database instance. And this is the only file you need to do that for all your projects.
这篇关于Sonar-Runner 与本地数据库对话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!