我有一个声纳配置,看起来像这样:
sonar.jdbc.username=sonar
sonar.jdbc.password=sonar
sonar.jdbc.url=jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncod$
sonar.jdbc.driverClassName=com.mysql.jdbc.Driver
sonar.jdbc.validationQuery=select 1
sonar.web.host=127.0.0.1
sonar.web.context=/sonar
sonar.web.port=9000
当从我的gradle脚本运行这个时,它看起来像这样:
sonarProperties {
property "sonar.projectKey", "sonar-example"
property "sonar.projectName", "sonar example"
property "sonar.projectVersion", "1.0"
property "sonar.sources", "src/main/java"
property "sonar.binaries", "build"
property "sonar.test", "src/test/java"
property "sonar.language", "java"
property "sonar.profile", "Android Lint"
property "sonar.android.lint.report", "lint-report.xml"
property "sonar.dynamicAnalysis", "reuseReports"
property "sonar.sourceEncoding", "UTF-8"
property "sonar.junit.reportsPath", "build/outputs/reports/coverage/debug"
property "sonar.cobertura.reportPath", "build/outputs/reports/coverage/debug/cobertura.xml"
property "sonar.java.coveragePlugin", "cobertura"
property "sonar.host.url", "http://localhost:9000/sonar"
property "sonar.jdbc.username", "sonar"
property "sonar.jdbc.password", "sonar"
}
pepes-MacBook-Pro-4:android-robolectric-test pepe$ ./gradlew sonarRunner
:app:sonarRunner
SonarQube Runner 2.3
Java 1.7.0_75 Oracle Corporation (64-bit)
Mac OS X 10.10.3 x86_64
INFO: Runner configuration file: NONE
INFO: Project configuration file: /Users/pepe/development/android-robolectric-test/app/build/tmp/sonarRunner/sonar-project.properties
INFO: Default locale: "sv_SE", source code encoding: "UTF-8"
INFO: Work directory: /Users/pepe/development/android-robolectric-test/app/build/sonar
INFO: SonarQube Server 5.0.1
10:24:55.133 INFO - Load global referentials...
10:24:55.406 INFO - Load global referentials done: 276 ms
10:24:55.410 INFO - User cache: /Users/pepe/.sonar/cache
10:24:55.418 INFO - Install plugins
10:24:55.428 INFO - Download sonar-findbugs-plugin-2.4.jar
10:24:55.545 INFO - Download sonar-cpd-plugin-5.0.1.jar
10:24:55.552 INFO - Download sonar-scm-git-plugin-5.0.1.jar
10:24:55.608 INFO - Download sonar-core-plugin-5.0.1.jar
10:24:55.615 INFO - Download sonar-java-plugin-2.8.jar
10:24:55.675 INFO - Download sonar-scm-svn-plugin-5.0.1.jar
10:24:55.679 INFO - Download sonar-l10n-en-plugin-5.0.1.jar
10:24:55.683 INFO - Download sonar-email-notifications-plugin-5.0.1.jar
10:24:55.736 INFO - Install JDBC driver
10:24:55.740 INFO - Download mysql-connector-java-5.1.27.jar
10:24:55.753 INFO - Create JDBC datasource for jdbc:h2:tcp://localhost/sonar
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 3.580s
Final Memory: 7M/245M
INFO: ------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
ERROR: Unable to execute Sonar
ERROR: Caused by: Fail to connect to database
ERROR: Caused by: Cannot create PoolableConnectionFactory (Connection is broken: "java.net.ConnectException: Connection refused: localhost" [90067-176])
ERROR: Caused by: Connection is broken: "java.net.ConnectException: Connection refused: localhost" [90067-176]
ERROR: Caused by: Connection refused
ERROR:
ERROR: To see the full stack trace of the errors, re-run SonarQube Runner with the -e switch.
ERROR: Re-run SonarQube Runner using the -X switch to enable full debug logging.
:app:sonarRunner FAILED
FAILURE: Build failed with an exception.
应该添加到上面的sonarproperties中。
Gradle脚本的sonarproperties
部分缺少(最重要的)属性sonar.jdbc.url
,因此难怪它要尝试连接到H2(这是该属性的默认值)。
null 我是这么说的: 编辑:这不是因为gradle docker图像,而是任何图像。如果我使用Jenkins运行,并且它是一个容器,这也不起作用。尝试连接到172.x.x.1(主机地址)和公开的端口,但测试没有连接,但访问容器,并使用mysql客户机尝试相同的连接,我可以连接。
我正在尝试将spring连接到MySQL。然而,我得到以下错误,谁能帮助? 应用程序.属性: spring.datasource.url=jdbc:mysql:/localhost/osworks?createdatabaseifNotexist=true&servertimezone=utc spring.datasource.username=root spring.datasource.da
我正在尝试连接到MySQL服务器,但出现无法处理的错误。 java.sql.SQLNonTransientConnectionException:无法创建到数据库服务器的连接。尝试重新连接3次。放弃。com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:110)com.mysql.cj.jdbc.excepti
我试图连接到mysql数据库从docker图像。然而,这是投掷错误。 下面是我正在使用的docker图像。https://hub.docker.com/_/mysql/ 下面是我用来运行docker映像的命令。 以下是命令的输出 如果我使用docker检查IP并ping该IP,则显示IP不可访问。 如果我尝试使用和我遇到以下错误。 无法加载身份验证插件“缓存\u sha2\u密码”。
我正在尝试从Spring Boot应用程序连接到mySQL数据库。然而,当我试图运行它时,它显示出错误。 我如何解决这个问题? 错误 从我的文件中添加代码片段 pom。xml 应用属性 堆栈跟踪 我还没有在sql中手动创建表,因为我认为spring.jpa.hibernate.ddl-Auto=date应该这样做
我已经使用docker工具箱在视窗机器上安装了docker。我也在我的视窗机器上安装了mysql,服务器运行在端口3306上(localhost-127.0.0.1-在docker机器之外)。我在一个名为“micra-workq-svc”的docker网络内部的docker容器中运行一个冲刺启动应用程序,我希望在docker内部运行的应用程序连接到本地主机。我花了几个小时在谷歌上搜索,没有一个链接