How do I best work around Flyway issue 156?

ⅰ亾dé卋堺 提交于 2019-12-20 03:32:15

问题


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

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.

The relevant section of my pom.xml looks like this:

        <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>

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?


回答1:


Issue 156 only applies to OSGi environments.

baseDir refers to a location on the classpath.

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.



来源:https://stackoverflow.com/questions/9134786/how-do-i-best-work-around-flyway-issue-156

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!