Flyway not finding my sql migrations in db/migration

让人想犯罪 __ 提交于 2019-12-05 04:43:04

Don't forget to call compile first, to make sure the resources are copied over.

In my case I had to explicitely set

flyway.locations=classpath:db/migration

in my application.properties (Spring Boot) for it to work.

It has to be compiled:

mvn compile flyway:migrate

You may use

<executions>
          <execution>
            <id>compile</id>
            <phase>compile</phase>
            <goals>
              <goal>migrate</goal>
            </goals>
          </execution>
          <execution>
            <id>clean</id>
            <phase>clean</phase>
            <goals>
              <goal>clean</goal>
            </goals>
          </execution>
        </executions>

in

<plugin>..</plugin> 

and then just mvn compile is needed for execution of migrate task

Execute mvn command from directory where target dir is located.

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