org.liquibase.maven.plugins.LiquibaseConnectMojo Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of liquibase-maven-plugin Show documentation
Show all versions of liquibase-maven-plugin Show documentation
A Maven plugin wraps up some of the functionality of Liquibase
package org.liquibase.maven.plugins;
import liquibase.Liquibase;
import liquibase.command.CommandScope;
import liquibase.database.Database;
import liquibase.exception.LiquibaseException;
/**
* Test connection to the configured database.
*
* @goal connect
*/
public class LiquibaseConnectMojo extends AbstractLiquibaseMojo {
@Override
protected void performLiquibaseTask(Liquibase liquibase) throws LiquibaseException {
CommandScope connectCommand = new CommandScope("connect");
connectCommand.addArgumentValue("url", url);
connectCommand.addArgumentValue("username", username);
connectCommand.addArgumentValue("password", password);
connectCommand.addArgumentValue("catalog", defaultCatalogName);
connectCommand.addArgumentValue("schema", defaultSchemaName);
connectCommand.provideDependency(Database.class, getLiquibase().getDatabase());
connectCommand.execute();
}
}