java - Spring Boot 1.4: Executing Method after Liquibase finished -
i have spring boot 1.4.0 based project uses liquibase.
is possible execute method after liquibase finished?
something bean post processor?
what want adding data database when application started in development mode. in developement mode application uses in-memory h2 database, liquibase has create tables before can write data.
spring boot auto-configures springliquibase
bean named liquibase
. bean depends on bean created after liquibase has finished. example, use @postconstruct
populate database:
@bean @dependson("liquibase") public yourbean yourbean() { return new yourbean(); } static class yourbean { @postconstruct public void populatedatabase() { system.out.println("this called after liquibase has finished"); } }
Comments
Post a Comment