2013-05-10 128 views
0

我試圖使用詹金斯聲納插件,詹金斯/聲納集成

每當我嘗試做一個生成我得到以下錯誤;

> 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 

在詹金斯聲納我的配置文件中包含了以下內容:

> # 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 

我在這裏找到的驅動程序缺少什麼設置?

感謝

+0

可能是driverClassName之後的冒號應該是=? – RobAu 2013-10-08 12:06:29

回答

0

檢查Maven的日誌和你的pom.xml:我懷疑你使用的是舊版本的Maven插件聲納的。

也許你正在迫使它的版本爲2.0。

插件應該是

org.codehaus.sonar:聲納-行家-插件:3.5

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

+0

即時消息根本不使用maven? – Biscuit128 2013-05-10 15:33:31

+0

你是否按照這些指示? http://docs.codehaus.org/display/SONAR/Installing+and+Configuring+Sonar+Runner不要忘記設置SONAR_RUNNER_HOME環境變量。 – 2013-05-11 09:23:38

+0

你的聲納運動員是否沒有詹金斯?我的意思是你可以訪問你的聲納的URL? – hjelpmig 2013-07-08 12:59:46