小编gab*_*iel的帖子

liquibase-hibernate5无法与liquibase-maven-plugin一起使用

我正在使用Spring Boot Starter 1.4.2.RELEASE + Hibernate 5 + Hibernate Spatial + Liquibase 3.5.3 + Liquibase Hibernate 5(liquibase-hibernate5 3.6)+ PostgreSQL,但我无法使liquibase:diff目标工作。

这是我的设置:

      <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&amp;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>
Run Code Online (Sandbox Code Playgroud)

运行mvn clean compile liquibase:diff -X给我以下异常:

. …
Run Code Online (Sandbox Code Playgroud)

spring hibernate liquibase spring-boot liquibase-hibernate

5
推荐指数
1
解决办法
1433
查看次数