【发布时间】:2015-03-23 22:16:16
【问题描述】:
JDBC 驱动程序需要位于非类路径目录中。我正在使用 Maven 来设置 Flyway DB 的配置,并将 migrate 作为目标。我在jarDir 配置部分提供了 JDBC 驱动程序的位置,但是当我执行migrate 目标时,它仍然无法识别相关的 JDBC 驱动程序。
<plugin>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-maven-plugin</artifactId>
<version>3.0</version>
<executions>
<execution>
<id>sql-enrichment-setup</id>
<phase>pre-integration-test</phase>
<goals>
<goal>migrate</goal>
</goals>
<configuration>
<url>jdbc:postgresql://localhost/enrichment?charSet=utf8</url>
<user>enrichment</user>
<password>enrichment</password>
<schemas>
<schema>public</schema>
</schemas>
<table>schema_history</table>
<initVersion>1.0</initVersion>
<initDescription>Base Migration</initDescription>
<jarDir>/Users/abc/jars</jarDir>
<skip>${skipITs}</skip>
<locations>
<location>
filesystem:${basedir}/integration-test-helpers/sql/enrichment/migrations
</location>
</locations>
</configuration>
</execution>
</executions>
</plugin>
但是,当我执行时,我仍然得到:
未能在项目 esa-core: org.flywaydb.core.api.FlywayException 上执行目标 org.flywaydb:flyway-maven-plugin:3.0:migrate (sql-enrichment-setup):无法实例化 jdbc 驱动程序:org .postgresql.Driver
我该如何解决这个问题?
【问题讨论】:
标签: flyway