Class 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 Detail

      • project

        @Parameter(defaultValue="${project}",
                   readonly=true)
        public org.apache.maven.project.MavenProject project
      • includes

        @Parameter
        public @Nullable String[] includes
        Resource name prefixes to include in the scan. To include package com.foo.bar you specify com/foo/bar here. 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 includeDependencies
        Whether the dependencies of this project should be included in the scan. Otherwise only the direct output is scanned.
      • failBuildOnUnprocessableClassPathElement

        @Parameter(defaultValue="true")
        public boolean failBuildOnUnprocessableClassPathElement
        Whether the build will fail if the class path contains an unsupported element (such as .war or .ear files). When set to false a warning is logged instead.
      • followSymlinks

        @Parameter(defaultValue="false")
        public boolean followSymlinks
        Whether 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 outputDirectory
        The directory where scan results are placed. The default value corresponds to the default "migratedb.location" configuration ("db/migration").
    • Constructor Detail

      • ScanMojo

        public ScanMojo()
    • Method Detail

      • execute

        public void execute()
                     throws org.apache.maven.plugin.MojoExecutionException,
                            org.apache.maven.plugin.MojoFailureException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
        org.apache.maven.plugin.MojoFailureException