Package migratedb.v1.maven
Class ScanMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
migratedb.v1.maven.ScanMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
@Mojo(name="scan",
defaultPhase=PROCESS_CLASSES,
threadSafe=true,
requiresDependencyResolution=COMPILE_PLUS_RUNTIME)
public class ScanMojo
extends org.apache.maven.plugin.AbstractMojo
Scans the output of this project (and optionally its dependencies) for database migration resources, e.g. scripts, so
they can be found as a 'classpath:' location.
MigrateDB looks for the scan results in db/migration unless you tweak its configuration.
-
Field Summary
FieldsModifier and TypeFieldDescriptionbooleanWhether the build will fail if the class path contains an unsupported element (such as .war or .ear files).booleanWhether the scan will follow symlinks, which can lead to an exception when symlinks create a cycle, e.g., by pointing to one of their parent directories.booleanWhether the dependencies of this project should be included in the scan.@Nullable String[]Resource name prefixes to include in the scan.The directory where scan results are placed.org.apache.maven.project.MavenProjectFields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Field Details
-
project
@Parameter(defaultValue="${project}", readonly=true) public org.apache.maven.project.MavenProject project -
includes
Resource name prefixes to include in the scan. To include packagecom.foo.baryou specifycom/foo/barhere. The separator is always a forward slash and does not depend on the file system implementation.The default value corresponds to the default migration directory/package:
"db/migration" -
includeDependencies
@Parameter(defaultValue="false") public boolean includeDependenciesWhether the dependencies of this project should be included in the scan. Otherwise only the direct output is scanned. -
failBuildOnUnprocessableClassPathElement
@Parameter(defaultValue="true") public boolean failBuildOnUnprocessableClassPathElementWhether the build will fail if the class path contains an unsupported element (such as .war or .ear files). When set tofalsea warning is logged instead. -
followSymlinks
@Parameter(defaultValue="false") public boolean followSymlinksWhether the scan will follow symlinks, which can lead to an exception when symlinks create a cycle, e.g., by pointing to one of their parent directories. -
outputDirectory
@Parameter(defaultValue="${project.build.outputDirectory}/db/migration") public File outputDirectoryThe directory where scan results are placed. The default value corresponds to the default"migratedb.location"configuration ("db/migration").
-
-
Constructor Details
-
ScanMojo
public ScanMojo()
-
-
Method Details
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException- Throws:
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureException
-