【发布时间】:2014-11-17 08:23:27
【问题描述】:
我正在处理 Maven 项目,并且我添加了 flyway 插件,它执行 sql 脚本以进行测试。我想确保这些脚本不会被意外执行,而只是使用 "mvn ... flyway:migrate"。
我发现 migrate 操作的默认阶段是 pre-integration-test,但是当我运行 mvn clean install flyway 时'没有被调用(这对我来说没问题,但我想知道为什么它们没有被调用)。
这是pom.xml的一部分:
<plugin>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-maven-plugin</artifactId>
<version>3.0</version>
<configuration>
<driver>${db-driver-name}</driver>
<url>${db-url}</url>
<user>${db-user-name}</user>
<password>${db-user-password}</password>
<locations>
<location>filesystem:./src/main/resources/db/scripts/V${db-version}</location>
</locations>
<schemas>
<schema>schema</schema>
</schemas>
</configuration>
<dependencies>
<dependency>
<groupId>oracle.jdbc</groupId>
<artifactId>ojdbc6</artifactId>
<version>11.2.0.4</version>
</dependency>
</dependencies>
</plugin>
提前致谢!
【问题讨论】:
标签: java maven maven-plugin flyway