|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.maven.plugin.AbstractMojo
org.apache.maven.plugin.dependency.AnalyzeDepMgt
public class AnalyzeDepMgt
This mojo looks at the dependencies after final resolution and looks for mismatches in your dependencyManagement section. In versions of maven prior to 2.0.6, it was possible to inherit versions that didn't match your dependencyManagement. See MNG-1577 for more info. This mojo is also usefull for just detecting projects that override the dependencyManagement directly. Set ignoreDirect to false to detect these otherwise normal conditions.
Field Summary |
---|
Fields inherited from interface org.apache.maven.plugin.Mojo |
---|
ROLE |
Constructor Summary | |
---|---|
AnalyzeDepMgt()
|
Method Summary | |
---|---|
java.util.Map |
addExclusions(java.util.List exclusionList)
Returns a map of the exclusions using the Dependency ManagementKey as the keyset. |
void |
execute()
|
java.lang.String |
getArtifactManagementKey(org.apache.maven.artifact.Artifact artifact)
This function returns a string comparable with Dependency.GetManagementKey. |
java.util.List |
getExclusionErrors(java.util.Map exclusions,
java.util.Set allDependencyArtifacts)
Returns a List of the artifacts that should have been excluded, but were found in the dependency tree. |
java.lang.String |
getExclusionKey(org.apache.maven.artifact.Artifact artifact)
|
java.lang.String |
getExclusionKey(org.apache.maven.model.Exclusion ex)
|
java.util.Map |
getMismatch(java.util.Map depMgtMap,
java.util.Set allDependencyArtifacts)
Calculate the mismatches between the DependencyManagement and resolved artifacts |
org.apache.maven.project.MavenProject |
getProject()
|
boolean |
isFailBuild()
|
boolean |
isIgnoreDirect()
|
void |
logMismatch(org.apache.maven.artifact.Artifact dependencyArtifact,
org.apache.maven.model.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(org.apache.maven.project.MavenProject theProject)
|
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 |
Constructor Detail |
---|
public AnalyzeDepMgt()
Method Detail |
---|
public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException
public java.util.Map addExclusions(java.util.List exclusionList)
exclusionList
- to be added to the map.
public java.util.List getExclusionErrors(java.util.Map exclusions, java.util.Set 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 java.lang.String getExclusionKey(org.apache.maven.artifact.Artifact artifact)
public java.lang.String getExclusionKey(org.apache.maven.model.Exclusion ex)
public java.util.Map getMismatch(java.util.Map depMgtMap, java.util.Set allDependencyArtifacts)
depMgtMap
- contains the Dependency.GetManagementKey as the keyset for
quick lookup.allDependencyArtifacts
- contains the set of all artifacts to compare.
public void logMismatch(org.apache.maven.artifact.Artifact dependencyArtifact, org.apache.maven.model.Dependency dependencyFromDepMgt) throws org.apache.maven.plugin.MojoExecutionException
dependencyArtifact
- the artifact that was resolved.dependencyFromDepMgt
- the dependency listed in the DependencyManagement section.
org.apache.maven.plugin.MojoExecutionException
public java.lang.String getArtifactManagementKey(org.apache.maven.artifact.Artifact artifact)
artifact
- to gen the key for
public boolean isFailBuild()
public void setFailBuild(boolean theFailBuild)
theFailBuild
- the failBuild to setpublic org.apache.maven.project.MavenProject getProject()
public void setProject(org.apache.maven.project.MavenProject theProject)
theProject
- the project to setpublic boolean isIgnoreDirect()
public void setIgnoreDirect(boolean theIgnoreDirect)
theIgnoreDirect
- the ignoreDirect to set
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |