|
|
|
@ -21,6 +21,8 @@ import javax.sql.DataSource;
|
|
|
|
|
import liquibase.change.DatabaseChange;
|
|
|
|
|
import liquibase.integration.spring.SpringLiquibase;
|
|
|
|
|
|
|
|
|
|
import org.springframework.aot.hint.RuntimeHints;
|
|
|
|
|
import org.springframework.aot.hint.RuntimeHintsRegistrar;
|
|
|
|
|
import org.springframework.beans.factory.ObjectProvider;
|
|
|
|
|
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
|
|
|
|
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
|
|
|
@ -30,6 +32,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
|
|
|
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
|
|
|
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
|
|
|
|
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
|
|
|
|
import org.springframework.boot.autoconfigure.liquibase.LiquibaseAutoConfiguration.LiquibaseAutoConfigurationRuntimeHints;
|
|
|
|
|
import org.springframework.boot.autoconfigure.liquibase.LiquibaseAutoConfiguration.LiquibaseDataSourceCondition;
|
|
|
|
|
import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
|
|
|
|
|
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
|
|
|
@ -39,6 +42,7 @@ import org.springframework.context.annotation.Bean;
|
|
|
|
|
import org.springframework.context.annotation.Conditional;
|
|
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
|
|
import org.springframework.context.annotation.Import;
|
|
|
|
|
import org.springframework.context.annotation.ImportRuntimeHints;
|
|
|
|
|
import org.springframework.jdbc.core.ConnectionCallback;
|
|
|
|
|
import org.springframework.jdbc.datasource.SimpleDriverDataSource;
|
|
|
|
|
import org.springframework.util.Assert;
|
|
|
|
@ -64,6 +68,7 @@ import org.springframework.util.StringUtils;
|
|
|
|
|
@ConditionalOnProperty(prefix = "spring.liquibase", name = "enabled", matchIfMissing = true)
|
|
|
|
|
@Conditional(LiquibaseDataSourceCondition.class)
|
|
|
|
|
@Import(DatabaseInitializationDependencyConfigurer.class)
|
|
|
|
|
@ImportRuntimeHints(LiquibaseAutoConfigurationRuntimeHints.class)
|
|
|
|
|
public class LiquibaseAutoConfiguration {
|
|
|
|
|
|
|
|
|
|
@Bean
|
|
|
|
@ -166,4 +171,13 @@ public class LiquibaseAutoConfiguration {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static class LiquibaseAutoConfigurationRuntimeHints implements RuntimeHintsRegistrar {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void registerHints(RuntimeHints hints, ClassLoader classLoader) {
|
|
|
|
|
hints.resources().registerPattern("db/changelog/db.changelog-master.yaml");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|