Package org.flywaydb.maven
Class RepairMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- org.flywaydb.maven.RepairMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
@Mojo(name="repair", requiresDependencyResolution=TEST, defaultPhase=PRE_INTEGRATION_TEST, threadSafe=true) public class RepairMojo extends org.apache.maven.plugin.AbstractMojoRepairs the Flyway schema history table. This will perform the following actions:- Remove any failed migrations on databases without DDL transactions (User objects left behind must still be cleaned up manually)
- Realign the checksums, descriptions and types of the applied migrations with the ones of the available migrations
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.StringdriverThe fully qualified classname of the JDBC driver to use to connect to the database.java.lang.BooleanfailOnMissingLocationsWhether to fail if a location specified in the flyway.locations option doesn't existprotected org.apache.maven.project.MavenProjectmavenProjectReference to the current project that includes the Flyway Maven plugin.protected org.apache.maven.settings.SettingssettingsThe link to the settings.xmlprotected booleanskipWhether to skip the execution of the Maven Plugin for this module.protected java.lang.StringurlThe JDBC url to use to connect to the database.protected java.lang.StringuserThe user to use to connect to the database.
-
Constructor Summary
Constructors Constructor Description RepairMojo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoExecute(org.flywaydb.core.Flyway flyway)Executes this mojo.voidexecute()protected booleangetBooleanProperty(java.lang.String systemPropertyName, boolean mavenPropertyValue)Retrieves the value of this boolean property, based on the matching System property on the Maven property.java.util.Map<java.lang.String,java.lang.String>getPluginConfiguration(java.util.Map<java.lang.String,java.lang.String> pluginConfiguration)protected java.lang.StringgetProperty(java.lang.String name)Retrieves this property from either the system or the maven properties.
-
-
-
Field Detail
-
skip
@Parameter(property="flyway.skip") protected boolean skip
Whether to skip the execution of the Maven Plugin for this module.Also configurable with Maven or System Property: ${flyway.skip}
-
driver
@Parameter(property="flyway.driver") protected java.lang.String driver
The fully qualified classname of the JDBC driver to use to connect to the database. By default, the driver is autodetected based on the url.Also configurable with Maven or System Property: ${flyway.driver}
-
url
@Parameter(property="flyway.url") protected java.lang.String url
The JDBC url to use to connect to the database.Also configurable with Maven or System Property: ${flyway.url}
-
user
@Parameter(property="flyway.user") protected java.lang.String user
The user to use to connect to the database. (default: blank) The credentials can be specified by user/password orserverIdfrom settings.xmlAlso configurable with Maven or System Property: ${flyway.user}
-
failOnMissingLocations
@Parameter(property="flyway.failOnMissingLocations") public java.lang.Boolean failOnMissingLocations
Whether to fail if a location specified in the flyway.locations option doesn't exist
-
settings
@Parameter(defaultValue="${settings}", readonly=true) protected org.apache.maven.settings.Settings settingsThe link to the settings.xml
-
mavenProject
@Parameter(defaultValue="${project}", readonly=true, required=true) protected org.apache.maven.project.MavenProject mavenProjectReference to the current project that includes the Flyway Maven plugin.
-
-
Method Detail
-
doExecute
protected void doExecute(org.flywaydb.core.Flyway flyway)
Executes this mojo.- Parameters:
flyway- The flyway instance to operate on.
-
getBooleanProperty
protected boolean getBooleanProperty(java.lang.String systemPropertyName, boolean mavenPropertyValue)Retrieves the value of this boolean property, based on the matching System property on the Maven property.- Parameters:
systemPropertyName- The name of the System property.mavenPropertyValue- The value of the Maven property.
-
execute
public final void execute() throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-
getPluginConfiguration
public java.util.Map<java.lang.String,java.lang.String> getPluginConfiguration(java.util.Map<java.lang.String,java.lang.String> pluginConfiguration)
-
getProperty
protected java.lang.String getProperty(java.lang.String name)
Retrieves this property from either the system or the maven properties.- Parameters:
name- The name of the property to retrieve.- Returns:
- The property value.
nullif not found.
-
-