Why my RCP application cannot detect migration files in a deployed Flyway / Spring project

I have a Spring / H2 / Hibernate project and am trying to integrate a span. The project is built using maven and creates a Jar, which is then included in other applications that access the database.

My problem is that when testing the project run, spring works fine and my circuit is created, however, when I deploy lib in another project, it looks like it does not find migration scripts. I checked they are in the jar file.

My spring config:

<bean id="flyway_database_1" class="org.flywaydb.core.Flyway" init-method="migrate">
    <property name="dataSource" ref="dataSource1" />
    <property name="locations" value="com.domain" />
    <property name="sqlMigrationPrefix" value="DATABASE_1_V" />
</bean>

<bean id="dataSource1" class="org.apache.commons.dbcp.BasicDataSource"
    destroy-method="close">
    <property name="driverClassName" value="${database.1.driver}" />
    <property name="url" value="${database.1.url}" />
</bean>

My application finds the spring Context XML XML file and the properties file both in the classpath, but the flyover doesn't seem to find the sql files.

"com.domain", "com/domain", "classpath:/", "classpath:/database1/migration/"

spring, , .

, ?

EDIT: , - , RCP, , , FlyWay , Spring?

, , RCP, DB, .

+4
1

flyway-core, ? sql- jar . . https://github.com/flyway/flyway/issues/1261. ​​ 4.1, , flyway-core.

<dependency>
    <groupId>org.flywaydb</groupId>
    <artifactId>flyway-core</artifactId>
    <version>4.2.0</version>
</dependency>

filesystem:, , , ?

<property name="locations" value="filesystem:C:/project/spring-flyway/src/main/resources/db/migration" />

Flyway. https://github.com/flyway/flyway/issues/1630. db/migration .

+5

Source: https://habr.com/ru/post/1676170/


All Articles