maven - 在 Maven 中使用 Liquibase 扩展

标签 maven liquibase

我正在尝试使用 Liquibase Oracle extensions来自 maven-liquibase-plugin但我无法让它工作。我对命令行中的相同 changeLog 文件没有任何问题,但在 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 依赖项添加为 插件依赖 .

关于maven - 在 Maven 中使用 Liquibase 扩展,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8214034/

相关文章:

maven - Eclipse Juno 中的生命周期配置错误未涵盖插件执行

java - Maven 不能在 jenkins 上运行(但它可以通过 eclipse 和命令行运行)

database - Liquibase 回滚不是智能确定语句执行的顺序。那是对的吗?

liquibase - 为什么 Maven liquibase :diff -DdiffExcludeObjects parameter does not work

java - 如何使用 Tycho 将 java 项目构建为带有 Maven 的 OSGi 部署包?

java - maven-archetype-j2ee-simple 原型(prototype)日志记录模块

mysql - liquibase SSL 对等点错误关闭

java - Liquibase 与 Tapestry 和 Hibernate 集成 : initial schema creation step

更改集内部更改的 Liquibase 执行顺序

linux - 无法签署 RPM : RPM sign execution returned: '127'