GithubHelp home page GithubHelp logo

jurrie / liquibase-maven-resource-filter Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 17 KB

A Maven resource filter for Liquibase files that will filter based on Liquibase contexts.

License: GNU Lesser General Public License v2.1

Java 100.00%

liquibase-maven-resource-filter's Introduction

Liquibase Maven resource filter

This is a file filter for the Maven resources plugin. It is used to filter Liquibase XML files, to only include certain contexts, and skip others. As this is used by maven-resources-plugin, the source files are not changed. Only the files that end up in the target directory are.

Usage

<plugin>
	<groupId>org.apache.maven.plugins</groupId>
	<artifactId>maven-resources-plugin</artifactId>
	<version>3.0.1</version>
	<executions>
		<execution>
			<id>copy-and-filter-remote-resources</id>
			<phase>generate-resources</phase>
			<goals>
				<goal>copy-resources</goal>
			</goals>
			<configuration>
				<resources>
					<resource>
						<directory>${project.build.directory}/maven-shared-archive-resources/</directory>
						<include>**/*.xml</include>
						<filtering>true</filtering>
					</resource>
					<resource>
						<directory>${project.build.directory}/maven-shared-archive-resources/</directory>
						<exclude>**/*.xml</exclude>
						<filtering>false</filtering>
					</resource>
				</resources>
				<outputDirectory>target/classes/liquibase</outputDirectory>
				<mavenFilteringHints>
					<mavenFilteringHint>LiquibaseResourceFilter</mavenFilteringHint>
				</mavenFilteringHints>
			</configuration>
		</execution>
	</executions>
	<dependencies>
		<dependency>
			<groupId>org.jurr.liquibase.maven.resourcefilter</groupId>
			<artifactId>liquibase-maven-resource-filter</artifactId>
			<version>1.0.0-SNAPSHOT</version>
		</dependency>
	</dependencies>
</plugin>

The plugin reads the Liquibase properties that you set for the org.liquibase:liquibase-maven-plugin plugin. The contexts given with -Dliquibase.contexts parameter (or in the -Dliquibase.propertyFile) are included. ChangeSets without context are included, as Liquibase would also include them during run.

Caveats

Files that do not have the .xml extension will not be filtered, but only copied. Files that do have the .xml extension are expected to be valid XML files. They do not have to be Liquibase files, but do have to contain some XML tags.

liquibase-maven-resource-filter's People

Contributors

jurrie avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.