Liquibase maven diff没有表现出差异

时间:2014-08-06 15:21:23

标签: maven-plugin liquibase

我刚刚开始使用Liquibase,并希望使用maven插件来显示两个不同数据库之间的差异(我知道事实是不同的,因为我创建了一个名为' wallawalla' in的随机表其中一个)但是Liquibase diff没有显示结果。

这是我的pom.xml:

    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
        <modelVersion>4.0.0</modelVersion>
        <groupId>com.me</groupId>
        <artifactId>databasechecker</artifactId>
        <version>0.0.1-SNAPSHOT</version>


        <build>
            <plugins>
                <plugin>
                    <groupId>org.liquibase</groupId>
                    <artifactId>liquibase-maven-plugin</artifactId>
                    <version>3.2.2</version>
                    <configuration>
                        <propertyFile>liquibase.properties</propertyFile>
                    </configuration>

                    <dependencies>
                        <dependency>
                            <groupId>org.liquibase.ext</groupId>
                            <artifactId>liquibase-hibernate3</artifactId>
                            <version>3.4</version>
                        </dependency>
                        <dependency>
                            <groupId>org.liquibase</groupId>
                            <artifactId>liquibase-core</artifactId>
                            <version>3.2.2</version>
                        </dependency>
                    </dependencies>
                </plugin>
            </plugins>
        </build>
    </project>

这是我的liquibase.properties:

    changeLogFile=changelog-master.xml

    url=jdbc:oracle:thin:@xxxxxx.com:1521:ORCL
    driver=oracle.jdbc.driver.OracleDriver
    username=synch_dev
    password=xxxxxx


    referenceUrl=jdbc:mysql://localhost:3306/test
    referenceDriver=com.mysql.jdbc.Driver
    referenceUsername=root
    referencePassword=xxxxxx

然后我跑:

    c:\Dev\eclipseworkspace\databasechecker>mvn liquibase:diff

但它没有显示变化:

    Diff Results:
    Reference Database: root@localhost @ jdbc:mysql://localhost:3306/test (Default Schema: test)
    Comparison Database: SYNCH_DEV @ jdbc:oracle:thin:@xxxxxx:1521:ORCL (Default Schema: SYNCH_DEV)
    Product Name:
         Reference:   'MySQL'
         Target: 'Oracle'
    Product Version:
         Reference:   '5.6.11'
         Target: 'Oracle Database 11g Release 11.2.0.2.0 - 64bit Production'
    Missing Catalog(s): NONE
    Unexpected Catalog(s): NONE
    Changed Catalog(s): NONE
    Missing Column(s): NONE
    Unexpected Column(s): NONE
    Changed Column(s): NONE
    Missing Foreign Key(s): NONE
    Unexpected Foreign Key(s): NONE
    Changed Foreign Key(s): NONE
    Missing Index(s): NONE
    Unexpected Index(s): NONE
    Changed Index(s): NONE
    Missing Primary Key(s): NONE
    Unexpected Primary Key(s): NONE
    Changed Primary Key(s): NONE
    Missing Schema(s): NONE
    Unexpected Schema(s): NONE
    Changed Schema(s): NONE
    Missing Sequence(s): NONE
    Unexpected Sequence(s): NONE
    Changed Sequence(s): NONE
    Missing Stored Procedure(s): NONE
    Unexpected Stored Procedure(s): NONE
    Changed Stored Procedure(s): NONE
    Missing Table(s): NONE
    Unexpected Table(s): NONE
    Changed Table(s): NONE
    Missing Unique Constraint(s): NONE
    Unexpected Unique Constraint(s): NONE
    Changed Unique Constraint(s): NONE
    Missing View(s): NONE
    Unexpected View(s): NONE
    Changed View(s): NONE
    [INFO] ------------------------------------------------------------------------
    [INFO]
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD SUCCESSFUL
    [INFO] ------------------------------------------------------------------------

我有什么想法可以让它展示我的差异?

修改

当我在命令行上使用liquibase.bat直接调用liquibase时,diffs工作正常,liquibase.properties文件中的属性作为参数传递给命令。那么它是maven插件的错误,还是我错误地配置了它?

1 个答案:

答案 0 :(得分:2)

这看起来像Liquibase 3.2.2(https://liquibase.jira.com/browse/CORE-1987)的一个问题,在即将发布的3.2.3版本中已修复。