将 Liquibase 扩展与 Maven 结合使用

2024-04-08

我正在尝试使用Liquibase Oracle 扩展 http://liquibase.jira.com/wiki/display/CONTRIB/Oracle+Extensions from maven-liquibase-插件 http://www.liquibase.org/manual/maven但我无法让它工作。我对来自命令行的相同更改日志文件没有任何问题,但在 Maven 中我收到以下错误消息

SEVERE 21/11/11 14:49:liquibase: Error thrown as a SAXException: Unknown Liquibase extension: dropTrigger. Are you missing a jar from your classpath?

我正在使用的变更日志文件

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ora="http://www.liquibase.org/xml/ns/dbchangelog-ext" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-2.0.xsd http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
    <changeSet author="PE1926" id="ONCHANGE" runOnChange="true">
    <ora:dropTrigger schemaName="" triggerName="TRIGGER_01"/>
    <rollback>
        <sqlFile path="latest/trg/TRIGGER_01.sql" endDelimiter="$"/>
    </rollback>
</changeSet>

这是 pom.xml 摘录

[...]
<dependencies>
    <dependency>
        <groupId>com.oracle</groupId>
        <artifactId>ojdbc14</artifactId>
    </dependency>   
    <dependency>
        <groupId>org.liquibase.ext</groupId>
        <artifactId>liquibase-oracle</artifactId>
        <version>1.2.0</version>
    </dependency>   
</dependencies>

<build>
    <plugins>       
        <plugin>
            <groupId>org.liquibase</groupId>
            <artifactId>liquibase-maven-plugin</artifactId>
            <version>2.0.3</version>
            <executions>
                <execution>
                    <phase>process-resources</phase>
                    <goals><goal>status</goal></goals>
                </execution>
            </executions>
            <configuration>
                <changeLogFile>src/main/resources/update.xml</changeLogFile>    
                <propertyFile>${db-resources.dir}/liquibase.properties</propertyFile>
                <promptOnNonLocalDatabase>false</promptOnNonLocalDatabase>
                <verbose>true</verbose>
            </configuration>
        </plugin>
    </plugins>
</build>

我还尝试添加 liquibase-oracle 作为插件依赖项,但收到相同的错误消息。

这是使用 Maven Liquibase 扩展的正确方法吗?我错过了什么吗?


将所有 liquibase 依赖项添加为插件依赖.

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

将 Liquibase 扩展与 Maven 结合使用 的相关文章

随机推荐