簡體   English   中英

Jenkins / Sonar集成

[英]Jenkins / Sonar integration

我正在嘗試使用jenkins聲納插件,

每當我嘗試進行構建時,都會出現以下錯誤;

> ERROR: Error during Sonar runner execution ERROR: Unable to execute
> Sonar ERROR: Caused by: Fail to connect to database ERROR: Caused by:
> Cannot create JDBC driver of class 'org.h2.Driver' for connect URL
> 'http://localhost:9092/sonar' ERROR: Caused by: No suitable driver
> ERROR:  ERROR: To see the full stack trace of the errors, re-run Sonar
> Runner with the -e switch. ERROR: Re-run Sonar Runner using the -X
> switch to enable full debug logging. Build step 'Invoke Standalone
> Sonar Analysis' marked build as failure Finished: FAILURE

我的聲納服務器屬性文件包含以下條目

#----- Credentials
# Permissions to create tables and indexes must be granted to JDBC user.
# The schema must be created first.
sonar.jdbc.username=                       sonar
sonar.jdbc.password=                       sonar

#----- Embedded database H2
# Note : it does not accept connections from remote hosts, so the
# sonar server and the maven plugin must be executed on the same host.

# Comment the following line to deactivate the default embedded database.
sonar.jdbc.url=                           jdbc:h2:tcp://localhost:9092/sonar;create=true
sonar.jdbc.driverClassName:               org.h2.Driver

# directory containing H2 database files. By default it's the /data directory in the sonar installation.
sonar.embeddedDatabase.dataDir=D:/Sonar/sonar-3.2/data
# H2 embedded database server listening port, defaults to 9092
sonar.embeddedDatabase.port:               9092

我在jenkins中用於聲納的配置文件包含以下內容;

>  # Additional parameters sonar.jdbc.dialect=h2
> sonar.jdbc.driverClassName: org.h2.Driver
> sonar.jdbc.driver=D:\Sonar\sonar-3.2\extensions\jdbc-driver\h2\h2-1.3.167.jar

我在這里缺少什么設置來查找驅動程序?

謝謝

檢查您的Maven日志和pom.xml:我懷疑您使用的是舊版本的maven Sonar插件。

也許您將其版本強制為2.0。

插件應該是

org.codehaus.sonar:sonar-maven-plugin:3.5

要么

org.codehaus.sonar:sonar-maven3-plugin:3.5

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM