diff options
4 files changed, 2 insertions, 11 deletions
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/models/server.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/models/server.rb index 396ed766f53..8d9f74c1a9b 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/models/server.rb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/models/server.rb @@ -66,7 +66,6 @@ class Server add_property(sonar_info, 'Database URL') { sonar_property('sonar.jdbc.url') } add_property(sonar_info, 'Database Login') { sonar_property('sonar.jdbc.username') } add_property(sonar_info, 'Database Driver') { "#{jdbc_metadata.getDriverName()} #{jdbc_metadata.getDriverVersion()}" } - add_property(sonar_info, 'Database Driver Class') { sonar_property('sonar.jdbc.driverClassName') } add_property(sonar_info, 'Database Dialect (Hibernate)') { "#{Java::OrgSonarServerUi::JRubyFacade.getInstance().getDatabase().getDialect().getId()} (#{Java::OrgSonarServerUi::JRubyFacade.getInstance().getDatabase().getDialect().getHibernateDialectClass().getName()})" } add_property(sonar_info, 'External User Authentication') { realm_name } add_property(sonar_info, 'Automatic User Creation') { sonar_property(org.sonar.api.CoreProperties.CORE_AUTHENTICATOR_CREATE_USERS) } diff --git a/sonar-core/src/main/java/org/sonar/core/persistence/DefaultDatabase.java b/sonar-core/src/main/java/org/sonar/core/persistence/DefaultDatabase.java index caa1f9453ef..e6cb4c5e426 100644 --- a/sonar-core/src/main/java/org/sonar/core/persistence/DefaultDatabase.java +++ b/sonar-core/src/main/java/org/sonar/core/persistence/DefaultDatabase.java @@ -36,7 +36,6 @@ import org.sonar.core.persistence.profiling.PersistenceProfiling; import org.sonar.jpa.session.CustomHibernateConnectionProvider; import javax.sql.DataSource; - import java.sql.Connection; import java.sql.SQLException; import java.util.List; @@ -55,7 +54,6 @@ public class DefaultDatabase implements Database { private static final String SONAR_HIBERNATE = "sonar.hibernate."; private static final String SONAR_JDBC_DIALECT = "sonar.jdbc.dialect"; private static final String SONAR_JDBC_URL = "sonar.jdbc.url"; - private static final String SONAR_JDBC_DRIVER_CLASS_NAME = "sonar.jdbc.driverClassName"; private static final String VALIDATE = "validate"; private Settings settings; @@ -107,9 +105,7 @@ public class DefaultDatabase implements Database { throw new IllegalStateException("Can not guess the JDBC dialect. Please check the property " + SONAR_JDBC_URL + "."); } checkH2Database(); - if (!properties.containsKey(SONAR_JDBC_DRIVER_CLASS_NAME)) { - properties.setProperty(SONAR_JDBC_DRIVER_CLASS_NAME, dialect.getDefaultDriverClassName()); - } + properties.setProperty(DatabaseProperties.PROP_DRIVER, dialect.getDefaultDriverClassName()); } protected void checkH2Database() { @@ -205,7 +201,6 @@ public class DefaultDatabase implements Database { } private static void completeDefaultProperties(Properties props) { - completeDefaultProperty(props, DatabaseProperties.PROP_DRIVER, props.getProperty(DatabaseProperties.PROP_DRIVER_DEPRECATED)); completeDefaultProperty(props, DatabaseProperties.PROP_URL, DEFAULT_URL); completeDefaultProperty(props, DatabaseProperties.PROP_USER, props.getProperty(DatabaseProperties.PROP_USER_DEPRECATED, DatabaseProperties.PROP_USER_DEFAULT_VALUE)); completeDefaultProperty(props, DatabaseProperties.PROP_PASSWORD, DatabaseProperties.PROP_PASSWORD_DEFAULT_VALUE); diff --git a/sonar-core/src/test/java/org/sonar/core/persistence/DefaultDatabaseTest.java b/sonar-core/src/test/java/org/sonar/core/persistence/DefaultDatabaseTest.java index 2bf2a1d1e6e..094c68aac59 100644 --- a/sonar-core/src/test/java/org/sonar/core/persistence/DefaultDatabaseTest.java +++ b/sonar-core/src/test/java/org/sonar/core/persistence/DefaultDatabaseTest.java @@ -45,9 +45,8 @@ public class DefaultDatabaseTest { } @Test - public void shouldSupportDeprecatedProperties() { + public void shouldSupportDeprecatedUserProperty() { Settings settings = new Settings(); - settings.setProperty("sonar.jdbc.driver", "my.Driver"); settings.setProperty("sonar.jdbc.user", "me"); DefaultDatabase db = new DefaultDatabase(settings); @@ -55,7 +54,6 @@ public class DefaultDatabaseTest { Properties props = db.getProperties(); assertThat(props.getProperty("sonar.jdbc.username")).isEqualTo("me"); - assertThat(props.getProperty("sonar.jdbc.driverClassName")).isEqualTo("my.Driver"); } @Test diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/database/DatabaseProperties.java b/sonar-plugin-api/src/main/java/org/sonar/api/database/DatabaseProperties.java index e711c4c5aa3..de19dc03d5b 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/database/DatabaseProperties.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/database/DatabaseProperties.java @@ -25,7 +25,6 @@ public interface DatabaseProperties { String PROP_URL = "sonar.jdbc.url"; String PROP_DRIVER = "sonar.jdbc.driverClassName"; - String PROP_DRIVER_DEPRECATED = "sonar.jdbc.driver"; String PROP_USER = "sonar.jdbc.username"; String PROP_USER_DEPRECATED = "sonar.jdbc.user"; String PROP_USER_DEFAULT_VALUE = "sonar"; |