简体   繁体   English

在sonar-runner和jenkins中覆盖了sonar.jdbc.url参数

[英]sonar.jdbc.url parameter overwritten in sonar-runner and jenkins

I have a problem using Jenkins and Sonar. 我在使用Jenkins和Sonar时遇到问题。 Here is my setup: a main linux server hosting Jenkins and Sonar and a windows vm to build a project. 这是我的设置:托管JenkinsSonar的主要linux服务器,以及用于构建项目的Windows vm。 The windows vm is configured as a Jenkins slave , and the job I defined can successfully get project source and perform a ant build. Windows vm被配置为Jenkins 从属 ,并且我定义的作业可以成功获取项目源并执行ant构建。 But it fails at running Sonar analysis using sonar runner. 但是使用声纳运行器运行Sonar分析失败。

The error raised says "java.sql.SQLException: No database selected" and while looking at the console output, I see twice the jdbc url parameter: 引发的错误为“ java.sql.SQLException:未选择数据库”,在查看控制台输出时,我看到两次jdbc url参数:

... "-Dsonar.jdbc.url=jdbc:mysql://xxx.xx.xx.xxx:3306/sonar?userUnicode=true&characterEncoding=utf8" ... -Dsonar.jdbc.url=jdbc:mysql://xxx.xx.xx.xxx:3306 ...

So obviously the second parameter is the one used, and is missing the database name. 因此,显然第二个参数是使用的那个参数,并且缺少数据库名称。 If I change the second parameter and launch it from command line, it works fine. 如果我更改第二个参数并从命令行启动它,则它可以正常工作。

The question is: why my parameter is overwritten and how can I change it? 问题是:为什么我的参数被覆盖?如何更改?

Thanks for any help 谢谢你的帮助

在修改了几个参数之后,我的解决方法仅仅是重启Jenkins备用代理...由于这不是一个完整的解释,欢迎任何有更多详细信息的人发布另一个答案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM