我剛剛下載聲納3.2,並配置了sonar.properties文件連接到我的本地MySQL數據庫。我啓用了以下設置:聲納MySQL的安裝
sonar.jdbc.url: jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true
sonar.jdbc.driverClassName: com.mysql.jdbc.Driver
我能夠啓動服務器沒有任何錯誤,我能當我運行登錄到聲納接口然而「MVN聲納:聲納」我的Maven項目我得到的以下錯誤:
[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.0:sonar (default-cli) on project vrservices: Can not execute Sonar: Fail to connect to database: Cannot load JDBC driver class 'org.h2.Driver' -> [Help 1]
我已經看過,說把下面的代碼在settings.xml文件但是這仍然沒有解決這一問題的幾個論壇。
<profile>
<id>sonar</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<!-- EXAMPLE FOR MYSQL -->
<sonar.jdbc.url>jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8</sonar.jdbc.url>
<sonar.jdbc.driver>com.mysql.jdbc.Driver</sonar.jdbc.driver>
<sonar.jdbc.username>root</sonar.jdbc.username>
<sonar.jdbc.password></sonar.jdbc.password>
</properties>
</profile>
我想知道是否有人已經遇到這個問題,以及如果是的話你怎麼解決?
在此先感謝!
看來,聲納尋找的H2數據庫。你確定你已經正確設置了這裏描述的所有屬性嗎? http://docs.codehaus.org/display/SONAR/Installing+Sonar – ppapapetrou