Class AbstractDependencyMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.apache.maven.plugins.dependency.AbstractDependencyMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
- Direct Known Subclasses:
AbstractDependencyFilterMojo, AbstractFromConfigurationMojo, AddDependencyMojo, ListRepositoriesMojo, RemoveDependencyMojo, ResolvePluginsMojo
public abstract class AbstractDependencyMojo
extends org.apache.maven.plugin.AbstractMojo
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.sonatype.plexus.build.incremental.BuildContextFor IDE build support.private final org.apache.maven.project.MavenProjectPOM.protected final org.apache.maven.execution.MavenSessionThe Maven session.private booleanDeprecated.to be removed in 4.0; use -q command line option insteadprivate booleanSkip plugin execution completely.private booleanSkip plugin execution only during incremental builds (e.g.Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractDependencyMojo(org.apache.maven.execution.MavenSession session, org.sonatype.plexus.build.incremental.BuildContext buildContext, org.apache.maven.project.MavenProject project) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidfinal voidexecute()protected static booleanexistsInResolvedModel(org.apache.maven.project.MavenProject project, DependencyEntry coords, boolean managed) Checks whether the dependency exists in the project's declared (original) model after property interpolation, but before inheritance merging.org.apache.maven.project.MavenProjectprotected final booleanisSilent()Deprecated.to be removed in 4.0booleanisSkip()voidsetSilent(boolean silent) Deprecated.to be removed in 4.0; no API replacement, use -q command line option insteadvoidsetSkip(boolean skip) Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Field Details
-
session
protected final org.apache.maven.execution.MavenSession sessionThe Maven session. -
silent
Deprecated.to be removed in 4.0; use -q command line option insteadIf the plugin should be silent.- Since:
- 2.0
-
skip
@Parameter(property="mdep.skip", defaultValue="false") private boolean skipSkip plugin execution completely.- Since:
- 2.7
-
skipDuringIncrementalBuild
@Parameter(defaultValue="false") private boolean skipDuringIncrementalBuildSkip plugin execution only during incremental builds (e.g. triggered from M2E).- Since:
- 3.4.0
- See Also:
-
buildContext
private final org.sonatype.plexus.build.incremental.BuildContext buildContextFor IDE build support. -
project
private final org.apache.maven.project.MavenProject projectPOM.
-
-
Constructor Details
-
AbstractDependencyMojo
protected AbstractDependencyMojo(org.apache.maven.execution.MavenSession session, org.sonatype.plexus.build.incremental.BuildContext buildContext, org.apache.maven.project.MavenProject project)
-
-
Method Details
-
execute
public final void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException- Throws:
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureException
-
doExecute
protected abstract void doExecute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException- Throws:
org.apache.maven.plugin.MojoExecutionException-MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureException-MojoFailureException
-
getProject
public org.apache.maven.project.MavenProject getProject()- Returns:
- returns the project
-
isSkip
public boolean isSkip()- Returns:
skip
-
setSkip
public void setSkip(boolean skip) - Parameters:
skip-skip
-
isSilent
-
setSilent
Deprecated.to be removed in 4.0; no API replacement, use -q command line option instead- Parameters:
silent-silent
-
existsInResolvedModel
protected static boolean existsInResolvedModel(org.apache.maven.project.MavenProject project, DependencyEntry coords, boolean managed) Checks whether the dependency exists in the project's declared (original) model after property interpolation, but before inheritance merging. This catches dependencies declared with property references like${project.groupId}without false-positiving on inherited dependencies from a parent POM.
-