Class RemoveDependencyMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.apache.maven.plugins.dependency.AbstractDependencyMojo
org.apache.maven.plugins.dependency.RemoveDependencyMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
@Mojo(name="remove",
requiresProject=true,
threadSafe=true)
public class RemoveDependencyMojo
extends AbstractDependencyMojo
Removes a dependency from the project's
pom.xml.
Supports removing from <dependencies> or <dependencyManagement>.
Matching uses groupId, artifactId, type, and classifier for precision. If the dependency exists in Maven's resolved model but uses property references in the raw POM, a clear error directs the user to edit manually.
When removing a managed dependency from a parent POM, warns if child modules reference it without an explicit version.- Since:
- 3.11.0
-
Field Summary
Fields inherited from class AbstractDependencyMojo
sessionFields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
ConstructorsConstructorDescriptionRemoveDependencyMojo(org.apache.maven.execution.MavenSession session, org.sonatype.plexus.build.incremental.BuildContext buildContext, org.apache.maven.project.MavenProject project) -
Method Summary
Methods inherited from class AbstractDependencyMojo
execute, existsInResolvedModel, getProject, isSilent, isSkip, setSilent, setSkipMethods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Constructor Details
-
RemoveDependencyMojo
@Inject public RemoveDependencyMojo(org.apache.maven.execution.MavenSession session, org.sonatype.plexus.build.incremental.BuildContext buildContext, org.apache.maven.project.MavenProject project)
-
-
Method Details
-
doExecute
protected void doExecute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException- Specified by:
doExecutein classAbstractDependencyMojo- Throws:
org.apache.maven.plugin.MojoExecutionException-MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureException-MojoFailureException
-