Skip to content

Add an IncludeAll Filter


Implementing Liquibase extensions requires an understanding of Java. You will be creating classes, overriding methods, and working with inheritance hierarchies.

Project Setup

If you have not already created a repository to hold your code, see Your First Extension in the Getting Started guide.


By default, Liquibase's [includeAll] tag will include all valid changelog files in the referenced path which are valid changelog files. If you would like to limit the files, you can specify the filter attribute pointing to a class that implements the liquibase.changelog.IncludeAllFilter interface.


If you would like to control the ordering of files included, see Add an IncludeAll Comparator


Suppose you have a changelog directory containing many files and a process where you will sometimes want to archive a changelog file by changing the extension to .bak.xml. When you archive those files, you no longer want them executed by Liquibase.

If you create a class like this:

package com.example.includeall;

import liquibase.changelog.IncludeAllFilter;

public class NoBakFilesFilter implements IncludeAllFilter {

    public boolean include(String changeLogPath) {
        return !changeLogPath.contains(".bak.");

and add it to your Liquibase classpath, you can reference it in the filter attribute on your includeAll like this:

<?xml version="1.0" encoding="UTF-8"?>
    <includeAll path="com/example/changelogs/" filter="com.example.includeall.NoBakFilesFilter"/>


Unlike other extensions, there is no need to register your class in the META-INF/services directory.