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

    Fields
    Modifier and Type
    Field
    Description
    boolean
    Whether the build will fail if the class path contains an unsupported element (such as .war or .ear files).
    boolean
    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.
    boolean
    Whether 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.MavenProject
     

    Fields inherited from interface org.apache.maven.plugin.Mojo

    ROLE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     

    Methods inherited from class org.apache.maven.plugin.AbstractMojo

    getLog, getPluginContext, setLog, setPluginContext

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • 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.
    • 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 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.MojoExecutionException
      org.apache.maven.plugin.MojoFailureException