@Mojo(name="analyze-dep-mgt", requiresDependencyResolution=TEST, threadSafe=true) public class AnalyzeDepMgt extends AbstractMojo
| Constructor and Description |
|---|
AnalyzeDepMgt() |
| Modifier and Type | Method and Description |
|---|---|
Map<String,Exclusion> |
addExclusions(List<Exclusion> exclusionList)
Returns a map of the exclusions using the Dependency ManagementKey as the keyset.
|
void |
execute() |
String |
getArtifactManagementKey(Artifact artifact)
This function returns a string comparable with Dependency.GetManagementKey.
|
List<Artifact> |
getExclusionErrors(Map<String,Exclusion> exclusions,
Set<Artifact> allDependencyArtifacts)
Returns a List of the artifacts that should have been excluded, but were found in the dependency tree.
|
String |
getExclusionKey(Artifact artifact) |
String |
getExclusionKey(Exclusion ex) |
Map<Artifact,Dependency> |
getMismatch(Map<String,Dependency> depMgtMap,
Set<Artifact> allDependencyArtifacts)
Calculate the mismatches between the DependencyManagement and resolved artifacts
|
protected MavenProject |
getProject() |
protected boolean |
isFailBuild() |
protected boolean |
isIgnoreDirect() |
void |
logMismatch(Artifact dependencyArtifact,
Dependency dependencyFromDepMgt)
This function displays the log to the screen showing the versions and information about the artifacts that don't
match.
|
void |
setFailBuild(boolean theFailBuild) |
void |
setIgnoreDirect(boolean theIgnoreDirect) |
void |
setProject(MavenProject theProject) |
getLog, getPluginContext, setLog, setPluginContextpublic void execute()
throws MojoExecutionException,
MojoFailureException
public Map<String,Exclusion> addExclusions(List<Exclusion> exclusionList)
exclusionList - to be added to the map.public List<Artifact> getExclusionErrors(Map<String,Exclusion> exclusions, Set<Artifact> allDependencyArtifacts)
exclusions - a map of the DependencyManagement exclusions, with the ManagementKey as the key and Dependency
as the value.allDependencyArtifacts - resolved artifacts to be compared.public String getExclusionKey(Artifact artifact)
artifact - Artifactpublic String getExclusionKey(Exclusion ex)
ex - The exclusion key.public Map<Artifact,Dependency> getMismatch(Map<String,Dependency> depMgtMap, Set<Artifact> allDependencyArtifacts)
depMgtMap - contains the Dependency.GetManagementKey as the keyset for quick lookup.allDependencyArtifacts - contains the set of all artifacts to compare.public void logMismatch(Artifact dependencyArtifact, Dependency dependencyFromDepMgt) throws MojoExecutionException
dependencyArtifact - the artifact that was resolved.dependencyFromDepMgt - the dependency listed in the DependencyManagement section.MojoExecutionException - in case of errors.public String getArtifactManagementKey(Artifact artifact)
artifact - to gen the key forprotected final boolean isFailBuild()
public void setFailBuild(boolean theFailBuild)
theFailBuild - the failBuild to setprotected final MavenProject getProject()
public void setProject(MavenProject theProject)
theProject - the project to setprotected final boolean isIgnoreDirect()
public void setIgnoreDirect(boolean theIgnoreDirect)
theIgnoreDirect - the ignoreDirect to setCopyright © 2002–2020 The Apache Software Foundation. All rights reserved.