Liquibase Maven差异不显示差异 [英] Liquibase maven diff not showing differences

查看:173
本文介绍了Liquibase Maven差异不显示差异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I have just started using Liquibase, and wanted to use the maven plugin to show differences between two different databases (which I know for a fact are different because I have created a random table called 'wallawalla' in one of them) but Liquibase diff is showing no results.

这是我的pom.xml:

Here is my 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:

Here is my 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] ------------------------------------------------------------------------

有什么主意如何显示差异吗?

Any ideas how I can get it to show my diffs?

编辑

当我在命令行上直接使用liquibase.bat调用liquibase时,diffs可以正常工作,并且liquibase.properties文件中的属性作为参数传递给命令.那么这是Maven插件的错误,还是我配置不正确?

The diffs work fine when I call liquibase directly using liquibase.bat on the command line, with the properties from the liquibase.properties file passed as parameters to the command. So is it a bug with the maven plugin, or have I configured it incorrectly?

推荐答案

这似乎与Liquibase 3.2.2有关( https://liquibase.jira.com/browse/CORE-1987 ),该问题已在即将发布的3.2.3版本中修复.

This looks like an issue with Liquibase 3.2.2 (https://liquibase.jira.com/browse/CORE-1987) which is fixed in the upcoming 3.2.3 release.

这篇关于Liquibase Maven差异不显示差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆