我如何最好地解决Flyway问题156? [英] How do I best work around Flyway issue 156?

查看:71
本文介绍了我如何最好地解决Flyway问题156?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试配置Flyway,并遇到了问题156 ,在其中我无法逃脱以下消息:

I'm trying to get Flyway configured and have run up against issue 156, where I can't escape the following message:

[WARNING] Unable to find path for sql migrations: db/migration

该文件夹存在,包含一个名为V1__baseline.sql的sql脚本,并且在调用mvn flyway:migrate时相对于pom.xml和当前工作目录的路径.

The folder exists, contains an sql script named V1__baseline.sql and is relative to the path of both the pom.xml and the current working directory when invoking mvn flyway:migrate.

我的pom.xml的相关部分如下:

        <plugin>
            <groupId>com.googlecode.flyway</groupId>
            <artifactId>flyway-maven-plugin</artifactId>
            <version>1.5</version>
            <configuration>
                <serverId>myServer</serverId>
                <driver>com.mysql.jdbc.Driver</driver>
                <url>jdbc:mysql://localhost:3306/myProject</url>
                <table>schema_history</table>
                <baseDir>db/migration</baseDir>
                <basePackage>com.mycompany.myProject.migration</basePackage>
                <validationMode>ALL</validationMode>
            </configuration>
        </plugin>

这似乎是一个已知的问题,但是鉴于第一份报告是2011年8月发布的,并且仍然存在于当前的稳定版本(1.5)中,因此对此问题的讨论很少.

This appears to be a known problem but there is remarkably little chatter about it given that the first report is from August 2011 and that it still exists in the current stable version (1.5).

你们所有人都必须以某种方式解决它.诀窍是什么?

You all must be working around it somehow. What's the trick?

推荐答案

问题156仅适用于OSGi环境.

Issue 156 only applies to OSGi environments.

baseDir 指的是类路径上的位置.

在您的情况下,这将是:PROJECT_ROOT/src/main/resources/db/migration

In your case this would be: PROJECT_ROOT/src/main/resources/db/migration

将您的迁移放入此处,它应该可以正常工作.我将再看看这些文档,看看是否可以对此进行澄清.

Put your migrations there and it should work. I'll have another look at the docs to see if they can be clarified regarding this.

这篇关于我如何最好地解决Flyway问题156?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆