Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added duplicateFileMode setting for maven plugin #3119

Merged
merged 1 commit into from Aug 2, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -2,6 +2,7 @@
// Copyright: Copyright(c) 2007 Trace Financial Limited
package org.liquibase.maven.plugins;

import liquibase.GlobalConfiguration;
import liquibase.Liquibase;
import liquibase.Scope;
import liquibase.configuration.core.DeprecatedConfigurationValueProvider;
Expand All @@ -17,6 +18,7 @@
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;

/**
* A Liquibase MOJO that requires the user to provide a DatabaseChangeLogFile to be able
Expand Down Expand Up @@ -92,6 +94,16 @@ public abstract class AbstractLiquibaseChangeLogMojo extends AbstractLiquibaseMo
@PropertyElement(key = "liquibase.hub.mode")
protected String hubMode;


/**
* How to handle multiple files being found in the search path that have duplicate paths.
* Options are WARN (log warning and choose one at random) or ERROR (fail current operation)
*
* @parameter property="liquibase.duplicateFileMode" default-value="ERROR"
*/
@PropertyElement
protected String duplicateFileMode;

@Override
protected void checkRequiredParametersAreSpecified() throws MojoFailureException {
super.checkRequiredParametersAreSpecified();
Expand Down Expand Up @@ -122,6 +134,9 @@ protected void performLiquibaseTask(Liquibase liquibase) throws LiquibaseExcepti
if (StringUtil.isNotEmpty(hubMode)) {
DeprecatedConfigurationValueProvider.setData(HubConfiguration.LIQUIBASE_HUB_MODE.getKey(), hubMode);
}
if (StringUtil.isNotEmpty(duplicateFileMode)) {
DeprecatedConfigurationValueProvider.setData(GlobalConfiguration.DUPLICATE_FILE_MODE.getKey(), GlobalConfiguration.DuplicateFileMode.valueOf(duplicateFileMode.toUpperCase(Locale.ROOT)));
}
}

@Override
Expand Down