Class AbstractDependencyVersionsMojo

java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.basepom.mojo.dvc.AbstractDependencyVersionsMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo, Context
Direct Known Subclasses:
DependencyVersionsCheckMojo, DependencyVersionsListMojo

public abstract class AbstractDependencyVersionsMojo extends org.apache.maven.plugin.AbstractMojo implements Context
Base code for all the mojos. Contains the dependency resolvers and the common options.
  • Field Details

    • project

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

      @Parameter(defaultValue="${session}", readonly=true) public org.apache.maven.execution.MavenSession mavenSession
    • reactorProjects

      @Parameter(defaultValue="${reactorProjects}", readonly=true, required=true) public List<org.apache.maven.project.MavenProject> reactorProjects
    • mavenProjectBuilder

      @Component public org.apache.maven.project.ProjectBuilder mavenProjectBuilder
    • projectDependenciesResolver

      @Component public org.apache.maven.project.ProjectDependenciesResolver projectDependenciesResolver
    • repositorySystem

      @Component public org.eclipse.aether.RepositorySystem repositorySystem
    • strategyProvider

      The strategy provider. This can be requested by other pieces to add additional strategies.
    • exclusions

      @Parameter(alias="exceptions") public VersionCheckExcludes[] exclusions
      List of version checks that will be removed from the version check. This allows potential conflicts to be excluded.
       <exclusions>
         <exclusion>
           <dependency>...</dependency>
           <expected>...</expected>
           <resolved>...</resolved>
         </exclusion>
       </exclusions>
       

      Each element consists of a dependency pattern [groupId]:[artifactId] that supports wildcards and an expected version (which is the version is expected by the artifact) and a resolved version (the version that the dependency resolution has chosen).

    • skip

      @Parameter(defaultValue="false", property="dvc.skip") public boolean skip
      Skip the plugin execution.
    • includePomProjects

      @Parameter(defaultValue="false", property="dvc.include-pom-projects") public boolean includePomProjects
      Include POM projects when running on a multi-module project. Dependency resolution on a pom project almost never makes sense as it does not actually build any artifacts.
      Since:
      3.0.0
    • quiet

      @Parameter(defaultValue="false", property="dvc.quiet") public boolean quiet
      Silence all non-output and non-error messages.
      Since:
      3.0.0
    • scope

      @Parameter(defaultValue="test", property="scope") public String scope
      Dependency resolution scope. Defaults to test. Valid choices are compile+runtime, compile, test and runtime.
      Since:
      3.0.0
    • deepScan

      @Parameter(defaultValue="false", property="dvc.deep-scan") public boolean deepScan
      Use deep scan or regular scan. Deep scan looks at all dependencies in the dependency tree, while regular scan only looks one level deep into the direct dependencies.
      Since:
      3.0.0
    • directOnly

      @Parameter(defaultValue="false", property="dvc.direct-only") public boolean directOnly
      List only direct dependencies or all dependencies.
      Since:
      3.0.0
    • managedOnly

      @Parameter(defaultValue="false", property="dvc.managed-only") public boolean managedOnly
      List only managed dependencies or all dependencies.
      Since:
      3.0.0
    • fastResolution

      @Parameter(defaultValue="true", property="dvc.fast-resolution") public boolean fastResolution
      Run dependency resolution in parallel with multiple threads. Should only ever set to false if the plugin shows stability problems when resolving dependencies. Please file a bug in that case, too.
      Since:
      3.0.0
    • resolvers

      @Parameter public ResolverDefinition[] resolvers
      List of resolvers to apply specific strategies to dependencies.
       <resolvers>
         <resolver>
           <strategy>...<strategy>
           <includes>
             <include>...<include>
           <includes>
         <resolver>
       <resolvers>
       

      A resolver maps a specific strategy to a list of includes. The include syntax is [group-id]:[artifact-id] where each pattern segment supports full and partial wildcards (*).
      The plugin includes some default strategies: apr, default, single-digit and two-digits-backward-compatible. Additional strategies can be defined and added to the plugin classpath.

    • defaultStrategy

      @Parameter(defaultValue="default", property="dvc.default-strategy") public String defaultStrategy
      Sets the default strategy to use to evaluate whether two dependency versions are compatible or not.

      The default resolution strategy matches the Maven dependency resolution itself; any two dependencies that maven considers compatible will be accepted.

      Since:
      3.0.0
  • Constructor Details

  • Method Details