Spring Boot-启动时禁用Liquibase [英] Spring boot - disable Liquibase at startup
问题描述
我想用我的春季启动应用程序配置Liquibase,所以我在pom.xml中添加了依赖项,并在application.properties中将路径设置为master.xml.这工作正常,Spring在启动时运行Liquibase.问题是现在我想手动运行Liquibase,而不是在应用程序启动时运行.我应该完全禁用Liquibase自动配置还是只能在启动时禁用运行评估?
I want to have Liquibase configured with my spring boot aplication, so I added dependencies to pom.xml and set the path to master.xml in application.properties. This works fine and Spring runs Liquibase at startup. The problem is that now I want to run Liquibase manually, not at startup of application. Should I completly disable Liquibase autoconfiguration or can i use it and only disable running evaluations at startup ?
推荐答案
Spring版本之间相关的属性名称已更改:
The relevant property name has changed between Spring versions:
-
对于 Spring 4.x.x :
liquibase.enabled=false
应用程序属性禁用Liquibase.
For Spring 4.x.x: the
liquibase.enabled=false
application property disables Liquibase.
对于 Spring 5.x.x :spring.liquibase.enabled=false
应用程序属性禁用Liquibase.
For Spring 5.x.x: the spring.liquibase.enabled=false
application property disables Liquibase.
P.S.对于Flyway:
P.S. And for Flyway:
-
Spring 4.x.x :
flyway.enabled=false
Spring 5.x.x :spring.flyway.enabled=false
这篇关于Spring Boot-启动时禁用Liquibase的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!