在Maven中使用Liquibase扩展 [英] Using Liquibase extensions with Maven
问题描述
我正在尝试使用
I am trying to use Liquibase Oracle extensions from maven-liquibase-plugin but I'm not able to get it working. I have no issue with the same changeLog file from the command line, but in Maven I get the following error message
SEVERE 21/11/11 14:49:liquibase: Error thrown as a SAXException: Unknown Liquibase extension: dropTrigger. Are you missing a jar from your classpath?
我正在使用的变更日志文件
The changelog file I'm using
<?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摘录
Here is a pom.xml extract
[...]
<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添加为插件依赖项,但得到了相同的错误消息.
I've also tried to add liquibase-oracle as plugin dependency but I get the same error message.
这是使用Maven的Liquibase扩展的正确方法吗?我想念什么吗?
Is this the correct way of using Liquibase extensions from Maven? Am I missing something?
推荐答案
将所有liquibase依赖项添加为插件依赖项.
Add all liquibase dependencies as plugin dependencies.
这篇关于在Maven中使用Liquibase扩展的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!