<plugin>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-maven-plugin</artifactId>
<version>${liquibase.version}</version>
<dependencies>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.1.0.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-spatial</artifactId>
<version>${hibernate.version}</version>
</dependency>
<dependency>
<groupId>org.javassist</groupId>
<artifactId>javassist</artifactId>
<version>3.18.2-GA</version>
</dependency>
<dependency>
<groupId>org.liquibase.ext</groupId>
<artifactId>liquibase-hibernate5</artifactId>
<version>${liquibase-hibernate5.version}</version>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>${postgresql.driver.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
<version>${project.parent.version}</version>
</dependency>
</dependencies>
<configuration>
<changeLogFile>src/main/resources/config/liquibase/master.xml</changeLogFile>
<diffChangeLogFile>src/main/resources/config/liquibase/changelog/${maven.build.timestamp}_changelog.xml</diffChangeLogFile>
<diffExcludeObjects>geography_columns, geometry_columns, raster_columns,
raster_overviews, spatial_ref_sys</diffExcludeObjects>
<driver>org.postgresql.Driver</driver>
<url>jdbc:postgresql://localhost:5432/mydb?useUnicode=true&characterEncoding=utf8</url>
<!--<defaultSchemaName></defaultSchemaName>-->
<username>myusr</username>
<password>mypwd</password>
<referenceUrl>hibernate:spring:my.package.with.domain?dialect=org.hibernate.spatial.dialect.postgis.PostgisDialect</referenceUrl>
<verbose>true</verbose>
<logging>debug</logging>
</configuration>
</plugin>
.
.
.
[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 -> org.hibernate.type.PostgresUUIDType@2486d0ae
[DEBUG] Adding type registration java.util.UUID -> 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 -> [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.<init>(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
我发现您可以添加属性-djadira.usertype.usejdbc42apis=false
来跳过此错误。请参见以下代码https://github.com/jadiraorg/jadira/blob/d55d0238395f0cb900531f1f08b4b2d87fa9a4f6/usertype.spi/src/main/java/org/jadira/usertype/spi/shared/abstractusertypeHibernateIntegrator.java#l56
我认为(未经测试)可以在配置中设置SystemProperties
。
<configuration>
<systemProperties>
<property>
<name>jadira.usertype.useJdbc42Apis</name>
<value>false</value>
</property>
</systemProperties>
</configuration
致以最诚挚的问候
当使用liquibase maven更新目标执行更新时,我得到了以下错误。 LiquiBase.Exception.ChangeLogParseException:解析db.changeLogDiff.xml的第4459行第108列时出错:cvc-complex-type.3.2.2:属性“Object QuotingStrategy”不允许出现在元素“Change Set”中。 diff生成的c
我正在使用用于Oracle12c数据库的Liquibase maven插件,但在运行update命令时出现以下错误: 我看到了与此问题相关的堆栈溢出帖子,其中建议对sqlnet.ora文件进行更改,但以下命令通过使用完全相同的changelog在命令行中工作很好: java-jar~/.m2/repository/org/liquibase/liquibase-core/3.5.3/liquiba
唉!上面的构造不起作用!LiquiBase找不到sql文件。 奇怪的是,当我将主脚本设置为绝对路径时,一切正常。但是,那不是我想要做的(我不想在databasechangelog表中有绝对路径)。
我对Maven和LiquiBase是新手。在过去的几天里,我一直在玩没有Maven的liquibase。我尝试用一个新数据库和一个现有数据库生成changelog文件。现在我正在尝试使用插件实现Maven和Liquibase。 > 从命令提示符运行带有Maven的Liquibase比仅仅从命令提示符运行Liquibase有什么好处? 生成pom.xml文件并为当前项目准备好src文件夹之后。我在p
case-0-3.sql: 我在进行任何更改之前标记数据库: 之后,我在每个文件应用后应用文件和标记数据库: 求求你,救命。可能有人在sql或其他格式中使用回滚操作?哪里错了?我做错了什么?它是工作液基功能吗?
我有一个基于Maven的项目,它使用Hibernate和Postgres(没有Spring)。 我想使用Liquibase进行数据库迁移。理想情况下,我想要以下工作流程: > 我添加了带有适当注释的实体类。我生成一个diff更改集(mvn liquibase: diff?)并将其输入存储库。 现在,我的团队中的每个人都从存储库中提取并运行一些东西(mvn更新?)以获取数据库的最新副本。 我根据需要