private void run() {
        // Create the FlywayHelper instance
        final Flyway flyway = Flyway.configure()
                .dataSource(url, username, password)
                .locations("stroom/db/migration/mysql")
                .table("schema_version")
                .load();

        if ("migrate".equals(action)) {
            flyway.migrate();
        } else if ("info".equals(action)) {
            printInfo(flyway.info().all());
        } else if ("clean".equals(action)) {
            flyway.clean();
        } else if ("validate".equals(action)) {
            flyway.validate();
        } else if ("undo".equals(action)) {
            throw new UnsupportedOperationException("'Undo' is only supported in Flyway Pro.");
        } else if ("baseline".equals(action)) {
            flyway.baseline();
        } else if ("repair".equals(action)) {
            flyway.repair();
        } else {
            LOGGER.error("Unsupported flyway action: '{}'", action);
        }
    }
This stand-alone class can be used to run Flyway migrations when run from a fat jar. E.g.
java -cp stroom-app-all.jar stroom.db.migration.FlywayHelper info
--url=jdbc:mysql... --username=root --password=my-secret-pw
<p>
It currently only supports 'info' and 'migrate'.
<p>
This class doesn't use any existing Flyway configuration because we might want to use it against other
databases, e.g. for testing migrations.
<p>
This class lives in Stroom because this gives it the benefit of having access to all the migrations
and to dependencies such as Saxon -- these are already on the classpath.
stroom-app/src/main/java/stroom/app/db/migration/FlywayHelper.java