org.liquibase.maven.provider.FlowCommandArgumentValueProvider 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.provider;
import liquibase.configuration.AbstractMapConfigurationValueProvider;
import java.util.Map;
public class FlowCommandArgumentValueProvider extends AbstractMapConfigurationValueProvider {
private final Map args;
public FlowCommandArgumentValueProvider(Map args) {
this.args = args;
}
@Override
public int getPrecedence() {
return 250;
}
@Override
protected Map, ?> getMap() {
return args;
}
@Override
protected String getSourceDescription() {
return "Arguments provided through maven when invoking flow or flow.validate maven goals";
}
@Override
protected boolean keyMatches(String wantedKey, String storedKey) {
if (super.keyMatches(wantedKey, storedKey)) {
return true;
}
if (wantedKey.startsWith("liquibase.command.")) {
return super.keyMatches(wantedKey.replaceFirst("^liquibase\\.command\\.", ""), storedKey);
}
return super.keyMatches(wantedKey.replaceFirst("^liquibase\\.", ""), storedKey);
}
}