jdbcantsonarqubesonar-runnersonarqube-4.5

Access Sonar server and its db without jdbc connection string


We have centralized SonarQube system. We are executing Sonar runner from different server that is our build machine. We are using a plugin which scans our source code. It uses ant build.xml to execute scan from runner. I know that we can use jdbc string and credential to access database. As per our org policy, we shouldn't directly access Sonar database. Sonar admin informed that only sonar host is required and it would access Sonar db without jdbc. but it goes to local h2 database by default when I run the script. SonarQube version 4.5.7. Also we can't upgrade the Sonar for now as it has dependency with other projects. Is there any workaround to access Sonar db without jdbc configuration?

sonar:sonar] 06:21:56.012 INFO - Install plugins [sonar:sonar] 06:21:56.083 INFO - Install JDBC driver [sonar:sonar] 06:21:56.115 INFO - Create JDBC datasource for jdbc:h2:tcp://localhost:9092/sonar


Solution

  • In 4.5.7, your only option is to provide full DB credentials to the analyses.

    Your best bet is to address the causes underlying "we can't upgrade" and then do the upgrade. By 5.2, analysis doesn't talk to the database. The current release is 6.3, and the current LTS is 5.6.6 - by which time you only need an authentication token and the instance URL.