try {
cl = getClassLoaderIncludingProjectClasspath();
Thread.currentThread().setContextClassLoader(cl);
}
catch (MojoExecutionException e) {
throw new LiquibaseException("Could not create the class loader, " + e, e);
}
Database db = liquibase.getDatabase();
Database referenceDatabase = CommandLineUtils.createDatabaseObject(cl, referenceUrl, referenceUsername, referencePassword, referenceDriver, referenceDefaultCatalogName, referenceDefaultSchemaName, outputDefaultCatalog, outputDefaultSchema, null, null, propertyProviderClass, null, null);
getLog().info("Performing Diff on database " + db.toString());
if (diffChangeLogFile != null) {
try {
CommandLineUtils.doDiffToChangeLog(diffChangeLogFile, referenceDatabase, db, new DiffOutputControl(diffIncludeCatalog, diffIncludeSchema, diffIncludeTablespace).addIncludedSchema(new CatalogAndSchema(referenceDefaultCatalogName, referenceDefaultSchemaName)), StringUtils.trimToNull(diffTypes));
getLog().info("Differences written to Change Log File, " + diffChangeLogFile);
}
catch (IOException e) {
throw new LiquibaseException(e);
}
catch (ParserConfigurationException e) {
throw new LiquibaseException(e);
}
} else {
CommandLineUtils.doDiff(referenceDatabase, db, StringUtils.trimToNull(diffTypes));
}
}