Reputation: 257
Since we use different application.properties files for different builds and deployments (for instance for different types of developers and test environments, in addition to deploying to Prod), I'd like to be able to change which init-method is configured for the Flyway bean in Spring's application-context.xml. I'd like to do something like this:
<context:property-placeholder location="classpath:application.properties,classpath:application-instance.properties"/>
<bean id="flyway" class="org.flywaydb.core.Flyway" init-method="${flyway.database.init.method}">
<property name="baselineOnMigrate" value="true" />
<property name="locations" value="classpath:/db-migrations/sql/" />
<property name="dataSource" ref="dataSource" />
</bean>
But even though I'm using this application.properties file in other placeholders in the XML config, I get this error:
.BeanDefinitionValidationException: Couldn't find an init method named '${flyway.database.init.method}' on bean with name 'flyway'
Upvotes: 2
Views: 557