mirror of
https://github.com/google/nomulus.git
synced 2025-05-21 11:49:37 +02:00
Fix missing-driver in HibernateSchemaExporterTest (#777)
* Fix missing-driver in HibernateSchemaExporterTest HibernateSchemaExporterTest is failing with "Driver not found" error after Java 11 upgrade. Reason is that ServiceLoader now only checks modules for services. Proper fix is to define modules. This short term fix is to declare the driver class explicitly.
This commit is contained in:
parent
8d38086d40
commit
c36f0c89c8
1 changed files with 3 additions and 0 deletions
|
@ -59,6 +59,9 @@ public class HibernateSchemaExporter {
|
||||||
settings.put(Environment.USER, username);
|
settings.put(Environment.USER, username);
|
||||||
settings.put(Environment.PASS, password);
|
settings.put(Environment.PASS, password);
|
||||||
settings.put(Environment.HBM2DDL_AUTO, "none");
|
settings.put(Environment.HBM2DDL_AUTO, "none");
|
||||||
|
// Register driver explicitly to work around ServiceLoader change after Java 8.
|
||||||
|
// Driver self-registration only works if driver is declared in a module.
|
||||||
|
settings.put(Environment.DRIVER, "org.postgresql.Driver");
|
||||||
settings.put(Environment.SHOW_SQL, "true");
|
settings.put(Environment.SHOW_SQL, "true");
|
||||||
settings.put(
|
settings.put(
|
||||||
Environment.PHYSICAL_NAMING_STRATEGY, NomulusNamingStrategy.class.getCanonicalName());
|
Environment.PHYSICAL_NAMING_STRATEGY, NomulusNamingStrategy.class.getCanonicalName());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue