Want to deploy your JVM, Node.js and Go apps effortlessly to AWS? Try our service Boxfuse

Maven Plugin

Supported Maven Versions

  • Maven 2.2.1
  • Maven 3.x




Name Description
migrate Migrates the database
clean Drops all objects in the configured schemas
info Prints the details and status information about all the migrations
validate Validates the applied migrations against the ones available on the classpath
baseline Baselines an existing database, excluding all migrations up to and including baselineVersion
repair Repairs the metadata table


The Flyway Maven plugin can be configured in the following ways:

Directly in the configuration of the plugin

Limitation: Due to a long standing Maven bug it is not possible to configure empty values this way. You must use one of the other configurations ways instead.

Through Maven properties

        <!-- Properties are prefixed with flyway. -->

        <!-- List are defined as comma-separated values -->

        <!-- Individual placeholders are prefixed by flyway.placeholders. -->

Through an external config file

> mvn -Dflyway.configFile=myConfig.properties

Default is flyway.properties in the same directory as the POM.
Encoding is specified by flyway.encoding (Default: UTF-8)


Through System properties

> mvn -Dflyway.user=myUser -Dflyway.schemas=schema1,schema2 -Dflyway.placeholders.keyABC=valueXYZ

Overriding order

System properties override External config file overrides Maven properties override Plugin configuration


Besides configuring credentials through one of the 3 ways described above, it is also possible to externalize them in the Maven settings.xml file:

            <!-- By default Flyway will look for the server with the id 'flyway-db' -->
            <!-- This can be customized by configuring the 'serverId' property -->

Maven: migrate