title: liquibase-hibernate5 not working with liquibase-maven-plugin
body: <p>I'm using Spring Boot Starter 1.4.2.RELEASE + Hibernate 5 + Hibernate Spatial + Liquibase 3.5.3 + Liquibase Hibernate 5 (liquibase-hibernate5 3.6) + PostgreSQL and I can't make work the liquibase:diff goal.</p>
  
  <p>Here is my setup:</p>
  
  <pre><code>      &lt;plugin&gt;
              &lt;groupId&gt;org.liquibase&lt;/groupId&gt;
              &lt;artifactId&gt;liquibase-maven-plugin&lt;/artifactId&gt;
              &lt;version&gt;${liquibase.version}&lt;/version&gt;
              &lt;dependencies&gt;
                  &lt;dependency&gt;
                      &lt;groupId&gt;javax.validation&lt;/groupId&gt;
                      &lt;artifactId&gt;validation-api&lt;/artifactId&gt;
                      &lt;version&gt;1.1.0.Final&lt;/version&gt;
                  &lt;/dependency&gt;
                  &lt;dependency&gt;
                      &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
                      &lt;artifactId&gt;hibernate-spatial&lt;/artifactId&gt;
                      &lt;version&gt;${hibernate.version}&lt;/version&gt;
                  &lt;/dependency&gt;
                  &lt;dependency&gt;
                      &lt;groupId&gt;org.javassist&lt;/groupId&gt;
                      &lt;artifactId&gt;javassist&lt;/artifactId&gt;
                      &lt;version&gt;3.18.2-GA&lt;/version&gt;
                  &lt;/dependency&gt;
                  &lt;dependency&gt;
                      &lt;groupId&gt;org.liquibase.ext&lt;/groupId&gt;
                      &lt;artifactId&gt;liquibase-hibernate5&lt;/artifactId&gt;
                      &lt;version&gt;${liquibase-hibernate5.version}&lt;/version&gt;
                  &lt;/dependency&gt;
                  &lt;dependency&gt;
                      &lt;groupId&gt;org.postgresql&lt;/groupId&gt;
                      &lt;artifactId&gt;postgresql&lt;/artifactId&gt;
                      &lt;version&gt;${postgresql.driver.version}&lt;/version&gt;
                  &lt;/dependency&gt;
                  &lt;dependency&gt;
                      &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
                      &lt;artifactId&gt;spring-boot-starter-data-jpa&lt;/artifactId&gt;
                      &lt;version&gt;${project.parent.version}&lt;/version&gt;
                  &lt;/dependency&gt;
              &lt;/dependencies&gt;
              &lt;configuration&gt;
                  &lt;changeLogFile&gt;src/main/resources/config/liquibase/master.xml&lt;/changeLogFile&gt;
                  &lt;diffChangeLogFile&gt;src/main/resources/config/liquibase/changelog/${maven.build.timestamp}_changelog.xml&lt;/diffChangeLogFile&gt;
                  &lt;diffExcludeObjects&gt;geography_columns, geometry_columns, raster_columns,
                      raster_overviews, spatial_ref_sys&lt;/diffExcludeObjects&gt;
                  &lt;driver&gt;org.postgresql.Driver&lt;/driver&gt;
                  &lt;url&gt;jdbc:postgresql://localhost:5432/mydb?useUnicode=true&amp;amp;characterEncoding=utf8&lt;/url&gt;
                  &lt;!--&lt;defaultSchemaName&gt;&lt;/defaultSchemaName&gt;--&gt;
                  &lt;username&gt;myusr&lt;/username&gt;
                  &lt;password&gt;mypwd&lt;/password&gt;
  
                  &lt;referenceUrl&gt;hibernate:spring:my.package.with.domain?dialect=org.hibernate.spatial.dialect.postgis.PostgisDialect&lt;/referenceUrl&gt;
                  &lt;verbose&gt;true&lt;/verbose&gt;
                  &lt;logging&gt;debug&lt;/logging&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
  </code></pre>
  
  <p>Running mvn clean compile liquibase:diff -X gives me the following exception:</p>
  
  <pre><code>.
  .
  .
  [WARNING] HHH000181: No appropriate connection provider encountered, assuming application will be supplying connections
  [WARNING] HHH000342: Could not obtain connection to query metadata : The application must supply JDBC connections
  [INFO] HHH000400: Using dialect: org.hibernate.spatial.dialect.postgis.PostgisDialect
  [DEBUG] IdentifierCaseStrategy for both quoted and unquoted identifiers was set to the same strategy [MIXED]; that will likely lead to problems in schema update and validation if using quoted identifiers
  [INFO] HHH000422: Disabling contextual LOB creation as connection was null
  [DEBUG] Adding type registration pg-uuid -&gt; org.hibernate.type.PostgresUUIDType@2486d0ae
  [DEBUG] Adding type registration java.util.UUID -&gt; org.hibernate.type.PostgresUUIDType@2486d0ae
  [INFO] HHH000270: Type registration [java.util.UUID] overrides previous : org.hibernate.type.UUIDBinaryType@412e11bf
  .
  .
  .
  [INFO] ------------------------------------------------------------------------
  [INFO] BUILD FAILURE
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time: 6.495 s
  [INFO] Finished at: 2016-12-31T15:01:21+01:00
  [INFO] Final Memory: 60M/616M
  [INFO] ------------------------------------------------------------------------
  [ERROR] Failed to execute goal org.liquibase:liquibase-maven-plugin:3.5.3:diff (default-cli) on project my-application: Error setting up or running Liquibase: javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory: The application must supply JDBC connections -&gt; [Help 1]
  org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.liquibase:liquibase-maven-plugin:3.5.3:diff (default-cli) on project my-application: Error setting up or running Liquibase: javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
      at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
      at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
      at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
      at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
      at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
      at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
      at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
      at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
  Caused by: org.apache.maven.plugin.MojoExecutionException: Error setting up or running Liquibase: javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory
      at org.liquibase.maven.plugins.AbstractLiquibaseMojo.execute(AbstractLiquibaseMojo.java:398)
      at org.liquibase.maven.plugins.LiquibaseDatabaseDiff.execute(LiquibaseDatabaseDiff.java:146)
      at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
      ... 20 more
  Caused by: liquibase.exception.DatabaseException: javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory
      at liquibase.integration.commandline.CommandLineUtils.createDatabaseObject(CommandLineUtils.java:127)
      at org.liquibase.maven.plugins.LiquibaseDatabaseDiff.performLiquibaseTask(LiquibaseDatabaseDiff.java:166)
      at org.liquibase.maven.plugins.AbstractLiquibaseMojo.execute(AbstractLiquibaseMojo.java:394)
      ... 23 more
  Caused by: javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory
      at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.persistenceException(EntityManagerFactoryBuilderImpl.java:955)
      at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:880)
      at liquibase.ext.hibernate.database.HibernateSpringPackageDatabase.createEntityManagerFactory(HibernateSpringPackageDatabase.java:94)
      at liquibase.ext.hibernate.database.HibernateEjb3Database.buildMetadataFromPath(HibernateEjb3Database.java:51)
      at liquibase.ext.hibernate.database.HibernateDatabase.buildMetadata(HibernateDatabase.java:136)
      at liquibase.ext.hibernate.database.HibernateDatabase.setConnection(HibernateDatabase.java:75)
      at liquibase.database.DatabaseFactory.findCorrectDatabaseImplementation(DatabaseFactory.java:131)
      at liquibase.database.DatabaseFactory.openDatabase(DatabaseFactory.java:151)
      at liquibase.integration.commandline.CommandLineUtils.createDatabaseObject(CommandLineUtils.java:85)
      ... 25 more
  Caused by: java.lang.UnsupportedOperationException: The application must supply JDBC connections
      at org.hibernate.engine.jdbc.connections.internal.UserSuppliedConnectionProviderImpl.getConnection(UserSuppliedConnectionProviderImpl.java:44)
      at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator$ConnectionProviderJdbcConnectionAccess.obtainConnection(JdbcEnvironmentInitiator.java:180)
      at org.jadira.usertype.spi.shared.AbstractUserTypeHibernateIntegrator.use42Api(AbstractUserTypeHibernateIntegrator.java:83)
      at org.jadira.usertype.spi.shared.AbstractUserTypeHibernateIntegrator.integrate(AbstractUserTypeHibernateIntegrator.java:206)
      at org.hibernate.internal.SessionFactoryImpl.&lt;init&gt;(SessionFactoryImpl.java:278)
      at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:445)
      at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:877)
      ... 32 more
  [ERROR] 
  [ERROR] 
  [ERROR] For more information about the errors and possible solutions, please read the following articles:
  [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
  </code></pre>
  
  <p>I really don't understand why this happens. I tried everything. I'm doing SQL calls from my RestControllers through JPA Repositories without any problems. I'm also able to run other liquibase maven goals without problems (successful connection to DB). </p>
  
  <p>I would really appreciate if somebody could help me with this. Thanks.</p>