Skip to content

JEE CDI Integration

Liquibase can be run in a JEE CDI environment by implementing a number of CDI Producer methods. The CDI Liquibase integration is a simple CDI extension that performs a Liquibase update when the CDI container boots.

How to Configure

public class LiquibaseProducer {

    private DataSource myDataSource;

    public CDILiquibaseConfig createConfig() {
        CDILiquibaseConfig config = new CDILiquibaseConfig();
        return config;

    public DataSource createDataSource() throws SQLException {
        return myDataSource;

    public ResourceAccessor create() {
        return new ClassLoaderResourceAccessor(getClass().getClassLoader());


CDILiquibaseConfig Available Attributes

  • changelog
  • contexts
  • parameters
  • defaultSchema
  • dropFirst

If you don't want Liquibase to run you can configure the following system property:

Last update: May 23, 2023
Created: May 23, 2023