@Mojo(name="copy-database",
requiresProject=false)
public class CopyMojo
extends org.liquibase.maven.plugins.AbstractLiquibaseChangeLogMojo
| Modifier and Type | Field and Description |
|---|---|
protected String |
changeLogFile
Deprecated.
|
protected File |
changeLogSavePath |
static String |
DEFAULT_CHANGELOG_PATH |
protected boolean |
dropFirst
Whether or not to perform a drop on the database before executing the change.
|
protected Boolean |
interactiveMode
User settings use to check the interactiveMode.
|
protected String |
logging
Controls the level of logging from Liquibase when executing.
|
protected File |
mavenHome
The
M2_HOME parameter to use for forked Maven invocations. |
protected MigrateHelper |
migrator
The Maven Wagon manager to use when obtaining server authentication details.
|
protected org.apache.maven.project.MavenProject |
project |
protected String |
propertyFile
The Liquibase properties file used to configure the Liquibase
Liquibase. |
protected boolean |
stateSaved
Property to flag whether to copy data as well as structure of the database schema
|
protected boolean |
verbose
Controls the verbosity of the output from invoking the plugin.
|
protected org.apache.maven.artifact.manager.WagonManager |
wagonManager
The Maven Wagon manager to use when obtaining server authentication details.
|
| Constructor and Description |
|---|
CopyMojo() |
| Modifier and Type | Method and Description |
|---|---|
protected liquibase.database.Database |
createSourceDatabase() |
protected liquibase.database.Database |
createTargetDatabase() |
protected void |
doCopy() |
protected void |
doFieldHack() |
protected void |
dropAll(liquibase.Liquibase liquibase)
Drops the database.
|
void |
execute() |
protected void |
export(org.kualigan.tools.liquibase.Diff diff,
liquibase.database.Database target,
String diffTypes,
String suffix) |
protected void |
exportConstraints(org.kualigan.tools.liquibase.Diff diff,
liquibase.database.Database target) |
protected void |
exportIndexes(org.kualigan.tools.liquibase.Diff diff,
liquibase.database.Database target) |
protected void |
exportSchema(liquibase.database.Database source,
liquibase.database.Database target) |
protected void |
exportSequences(org.kualigan.tools.liquibase.Diff diff,
liquibase.database.Database target) |
protected void |
exportTables(org.kualigan.tools.liquibase.Diff diff,
liquibase.database.Database target) |
protected void |
exportViews(org.kualigan.tools.liquibase.Diff diff,
liquibase.database.Database target) |
void |
generateArchetype(File mavenHome,
Properties archetypeProperties)
Invokes the maven goal
archetype:generate with the appropriate properties. |
protected File |
getBasedir() |
protected String |
getChangeLogFile() |
protected Field |
getDeclaredField(Class clazz,
String fieldName)
Recursively searches for the field specified by the fieldName in the class and all
the super classes until it either finds it, or runs out of parents.
|
protected liquibase.resource.ResourceAccessor |
getFileOpener(ClassLoader cl) |
ClassLoader |
getMavenArtifactClassloader() |
File |
getMavenHome() |
void |
invokeCopy(File mavenHome,
Properties copyProperties)
Invokes the maven goal
archetype:generate with the appropriate properties. |
protected Boolean |
isStateSaved() |
String |
lookupDriverFor(String url) |
protected liquibase.database.jvm.JdbcConnection |
openConnection(String url,
String username,
String password,
String className,
String schema) |
protected void |
parsePropertiesFile(InputStream propertiesInputStream)
Parses a properties file and sets the assocaited fields in the plugin.
|
protected void |
printSettings(String indent) |
void |
setMavenHome(File mavenHome) |
protected void |
setupRequest(org.apache.maven.shared.invoker.InvocationRequest req,
String additionalArguments) |
protected void |
updateConstraints(liquibase.database.Database target,
ClassLoader artifactClassLoader) |
protected void |
updateIndexes(liquibase.database.Database target,
ClassLoader artifactClassLoader) |
protected void |
updateSchema(liquibase.database.Database target) |
protected void |
updateSequences(liquibase.database.Database target,
ClassLoader artifactClassLoader) |
protected void |
updateTables(liquibase.database.Database target,
ClassLoader artifactClassLoader) |
protected void |
updateViews(liquibase.database.Database target,
ClassLoader artifactClassLoader) |
checkRequiredParametersAreSpecified, createLiquibase, performLiquibaseTaskcleanup, configureFieldsAndValues, getClassLoaderIncludingProjectClasspath, getLiquibase, getMavenArtifactClassLoader, isPromptOnNonLocalDatabasepublic static final String DEFAULT_CHANGELOG_PATH
@Parameter(property="project",
defaultValue="${project}")
protected org.apache.maven.project.MavenProject project
@Parameter(property="interactiveMode",
defaultValue="${settings.interactiveMode}")
protected Boolean interactiveMode
@Component(role=org.apache.maven.artifact.manager.WagonManager.class) protected org.apache.maven.artifact.manager.WagonManager wagonManager
@Component(role=MigrateHelper.class) protected MigrateHelper migrator
@Parameter(property="liquibase.verbose",
defaultValue="false")
protected boolean verbose
@Parameter(property="liquibase.logging",
defaultValue="INFO")
protected String logging
@Parameter(property="liquibase.propertyFile") protected String propertyFile
Liquibase.@Parameter(property="liquibase.changeLogFile") protected String changeLogFile
@Parameter(property="liquibase.changeLogSavePath",
defaultValue="${project.basedir}/target/changelogs")
protected File changeLogSavePath
@Parameter(property="liquibase.dropFirst",
defaultValue="false")
protected boolean dropFirst
@Parameter(property="lb.copy.data",
defaultValue="true")
protected boolean stateSaved
public CopyMojo()
protected Boolean isStateSaved()
protected File getBasedir()
protected String getChangeLogFile() throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionprotected void doFieldHack()
public ClassLoader getMavenArtifactClassloader() throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionpublic String lookupDriverFor(String url)
public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
execute in interface org.apache.maven.plugin.Mojoexecute in class org.liquibase.maven.plugins.AbstractLiquibaseMojoorg.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureExceptionpublic void invokeCopy(File mavenHome, Properties copyProperties) throws org.apache.maven.plugin.MojoExecutionException
archetype:generate with the appropriate properties.org.apache.maven.plugin.MojoExecutionExceptionpublic void generateArchetype(File mavenHome, Properties archetypeProperties) throws org.apache.maven.plugin.MojoExecutionException
archetype:generate with the appropriate properties.org.apache.maven.plugin.MojoExecutionExceptionprotected void setupRequest(org.apache.maven.shared.invoker.InvocationRequest req, String additionalArguments) throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionprotected void doCopy() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureExceptionprotected void updateSchema(liquibase.database.Database target) throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionprotected void updateTables(liquibase.database.Database target, ClassLoader artifactClassLoader) throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionprotected void updateSequences(liquibase.database.Database target, ClassLoader artifactClassLoader) throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionprotected void updateViews(liquibase.database.Database target, ClassLoader artifactClassLoader) throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionprotected void updateIndexes(liquibase.database.Database target, ClassLoader artifactClassLoader) throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionprotected void updateConstraints(liquibase.database.Database target, ClassLoader artifactClassLoader) throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionprotected liquibase.database.Database createSourceDatabase() throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionprotected liquibase.database.Database createTargetDatabase() throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionprotected void dropAll(liquibase.Liquibase liquibase) throws liquibase.exception.LiquibaseException
liquibase - liquibase.exception.LiquibaseExceptionprotected void printSettings(String indent)
printSettings in class org.liquibase.maven.plugins.AbstractLiquibaseChangeLogMojoprotected void parsePropertiesFile(InputStream propertiesInputStream) throws org.apache.maven.plugin.MojoExecutionException
parsePropertiesFile in class org.liquibase.maven.plugins.AbstractLiquibaseMojopropertiesInputStream - The input stream which is the Liquibase properties that
needs to be parsed.org.apache.maven.plugin.MojoExecutionException - If there is a problem parsing
the file.protected Field getDeclaredField(Class clazz, String fieldName) throws NoSuchFieldException
clazz - The Class to start searching from.fieldName - The name of the field to retrieve.Field identified by the field name.NoSuchFieldException - If the field was not found in the class or any of its
super classes.protected void exportConstraints(org.kualigan.tools.liquibase.Diff diff, liquibase.database.Database target) throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionprotected void exportIndexes(org.kualigan.tools.liquibase.Diff diff, liquibase.database.Database target) throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionprotected void exportViews(org.kualigan.tools.liquibase.Diff diff, liquibase.database.Database target) throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionprotected void exportTables(org.kualigan.tools.liquibase.Diff diff, liquibase.database.Database target) throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionprotected void exportSequences(org.kualigan.tools.liquibase.Diff diff, liquibase.database.Database target) throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionprotected void export(org.kualigan.tools.liquibase.Diff diff, liquibase.database.Database target, String diffTypes, String suffix) throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionprotected void exportSchema(liquibase.database.Database source, liquibase.database.Database target) throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionprotected liquibase.database.jvm.JdbcConnection openConnection(String url, String username, String password, String className, String schema) throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionprotected liquibase.resource.ResourceAccessor getFileOpener(ClassLoader cl)
getFileOpener in class org.liquibase.maven.plugins.AbstractLiquibaseChangeLogMojopublic void setMavenHome(File mavenHome)
public File getMavenHome()
Copyright © 2004-2012 Kualigan. All Rights Reserved.