You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
In order to specify an external non-H2 database it is currently required to specify the dbDriver as the initial configuration already sets it to the H2 driver.
With JDBC 4.0 (introduced by Java 6) loading the dbDriver explicitly is no longer required, a proper connection-url suffices as long as the dbDriver is on the classpath.
When currently configuring the maven plugin with only an external connectionUrl, user and password the result is an error as the connection-url for postgres is not supported by the H2 driver which still gets activated as the driver to use because of this default configuration.
Describe the solution you'd like
We should assume that by now every dbDriver will be compliant with at least the ServiceLoader paradigm introduced by JDBC v4 in the JDBC specification. As JDBC4 does not require explicit driver loading before use it should suffice to specify the connectionString (and user credentials) in order to use an external database other than H2.
In addition to not requiring explicit driver class specification the software should not manually register and deregister the driver (legacy JDBC 3 behavior) by default for JDBC4 database drivers.
The existing explicit driver registration itself should remain an option for users that for some reason cannot put the databasedriver on the classpath (as in that case JDBC 4 ServiceLoader will not be able to auto-discover the driver and explicit loading with a custom classloader would be required) or wants to use an external database for which the drivers are not compliant with the JDBC 4 ServiceLoader mechanism.
Enabling JDBCv4 ServiceLoader based auto-configuration requires the dbDriver to be unset by default and only set when explicitly configured by the user.
Describe alternatives you've considered
Leave the configuration as is and always require specification of the driver classname in addition to the connection-url which means DependencyCheck will always use the legacy method of JDBC driver explicit registration.
Additional context
Extract from the mvn verify -Ppostgres -X output on a trial-project:
Is your feature request related to a problem? Please describe.
In order to specify an external non-H2 database it is currently required to specify the dbDriver as the initial configuration already sets it to the H2 driver.
With JDBC 4.0 (introduced by Java 6) loading the dbDriver explicitly is no longer required, a proper connection-url suffices as long as the dbDriver is on the classpath.
When currently configuring the maven plugin with only an external connectionUrl, user and password the result is an error as the connection-url for postgres is not supported by the H2 driver which still gets activated as the driver to use because of this default configuration.
Describe the solution you'd like
We should assume that by now every dbDriver will be compliant with at least the ServiceLoader paradigm introduced by JDBC v4 in the JDBC specification. As JDBC4 does not require explicit driver loading before use it should suffice to specify the connectionString (and user credentials) in order to use an external database other than H2.
In addition to not requiring explicit driver class specification the software should not manually register and deregister the driver (legacy JDBC 3 behavior) by default for JDBC4 database drivers.
The existing explicit driver registration itself should remain an option for users that for some reason cannot put the databasedriver on the classpath (as in that case JDBC 4 ServiceLoader will not be able to auto-discover the driver and explicit loading with a custom classloader would be required) or wants to use an external database for which the drivers are not compliant with the JDBC 4 ServiceLoader mechanism.
Enabling JDBCv4 ServiceLoader based auto-configuration requires the dbDriver to be unset by default and only set when explicitly configured by the user.
Describe alternatives you've considered
Leave the configuration as is and always require specification of the driver classname in addition to the connection-url which means DependencyCheck will always use the legacy method of JDBC driver explicit registration.
Additional context
Extract from the
mvn verify -Ppostgres -X
output on a trial-project:The text was updated successfully, but these errors were encountered: