Class ProjectDependencyAnalysis
java.lang.Object
org.apache.maven.shared.dependency.analyzer.ProjectDependencyAnalysis
Project dependencies analysis result.
- Author:
- Mark Hobson
-
Constructor Summary
ConstructorDescriptionConstructor for ProjectDependencyAnalysis.ProjectDependencyAnalysis
(Map<org.apache.maven.artifact.Artifact, Set<DependencyUsage>> usedDeclaredArtifacts, Map<org.apache.maven.artifact.Artifact, Set<DependencyUsage>> usedUndeclaredArtifacts, Set<org.apache.maven.artifact.Artifact> unusedDeclaredArtifacts, Set<org.apache.maven.artifact.Artifact> testArtifactsWithNonTestScope) ProjectDependencyAnalysis
(Set<org.apache.maven.artifact.Artifact> usedDeclaredArtifacts, Set<org.apache.maven.artifact.Artifact> usedUndeclaredArtifacts, Set<org.apache.maven.artifact.Artifact> unusedDeclaredArtifacts) Constructor for ProjectDependencyAnalysis to maintain compatibility with old APIProjectDependencyAnalysis
(Set<org.apache.maven.artifact.Artifact> usedDeclaredArtifacts, Set<org.apache.maven.artifact.Artifact> usedUndeclaredArtifacts, Set<org.apache.maven.artifact.Artifact> unusedDeclaredArtifacts, Set<org.apache.maven.artifact.Artifact> testArtifactsWithNonTestScope) Constructor for ProjectDependencyAnalysis. -
Method Summary
Modifier and TypeMethodDescriptionboolean
forceDeclaredDependenciesUsage
(String[] forceUsedDependencies) Force use status of some declared dependencies, to manually fix consequences of bytecode-level analysis which happens to not detect some effective use (constants, annotation with source-retention, javadoc).Set
<org.apache.maven.artifact.Artifact> Returns artifacts only used in tests but not declared with test scope.Set
<org.apache.maven.artifact.Artifact> Returns artifacts declared but not used.Set
<org.apache.maven.artifact.Artifact> Returns artifacts both used and declared.Map
<org.apache.maven.artifact.Artifact, Set<DependencyUsage>> Returns artifacts both used and declared.Set
<org.apache.maven.artifact.Artifact> Returns artifacts used but not declared.Returns artifacts used but not declared.Map
<org.apache.maven.artifact.Artifact, Set<DependencyUsage>> int
hashCode()
hashCode.Filter non-compile scoped artifacts from unused declared.toString()
toString.
-
Constructor Details
-
ProjectDependencyAnalysis
public ProjectDependencyAnalysis()Constructor for ProjectDependencyAnalysis.
-
ProjectDependencyAnalysis
public ProjectDependencyAnalysis(Set<org.apache.maven.artifact.Artifact> usedDeclaredArtifacts, Set<org.apache.maven.artifact.Artifact> usedUndeclaredArtifacts, Set<org.apache.maven.artifact.Artifact> unusedDeclaredArtifacts) Constructor for ProjectDependencyAnalysis to maintain compatibility with old API
- Parameters:
usedDeclaredArtifacts
- artifacts both used and declaredusedUndeclaredArtifacts
- artifacts used but not declaredunusedDeclaredArtifacts
- artifacts declared but not used
-
ProjectDependencyAnalysis
public ProjectDependencyAnalysis(Set<org.apache.maven.artifact.Artifact> usedDeclaredArtifacts, Set<org.apache.maven.artifact.Artifact> usedUndeclaredArtifacts, Set<org.apache.maven.artifact.Artifact> unusedDeclaredArtifacts, Set<org.apache.maven.artifact.Artifact> testArtifactsWithNonTestScope) Constructor for ProjectDependencyAnalysis.
- Parameters:
usedDeclaredArtifacts
- artifacts both used and declaredusedUndeclaredArtifacts
- artifacts used but not declaredunusedDeclaredArtifacts
- artifacts declared but not usedtestArtifactsWithNonTestScope
- artifacts only used in tests but not declared with test scope
-
ProjectDependencyAnalysis
public ProjectDependencyAnalysis(Map<org.apache.maven.artifact.Artifact, Set<DependencyUsage>> usedDeclaredArtifacts, Map<org.apache.maven.artifact.Artifact, Set<DependencyUsage>> usedUndeclaredArtifacts, Set<org.apache.maven.artifact.Artifact> unusedDeclaredArtifacts, Set<org.apache.maven.artifact.Artifact> testArtifactsWithNonTestScope)
-
-
Method Details
-
getUsedDeclaredArtifacts
Returns artifacts both used and declared.- Returns:
- artifacts both used and declared
-
getUsedDeclaredArtifactsWithUsages
public Map<org.apache.maven.artifact.Artifact,Set<DependencyUsage>> getUsedDeclaredArtifactsWithUsages()Returns artifacts both used and declared.- Returns:
- artifacts both used and declared
-
getUsedUndeclaredArtifacts
Returns artifacts used but not declared.- Returns:
- artifacts used but not declared
-
getUsedUndeclaredArtifactsWithClasses
Returns artifacts used but not declared.- Returns:
- artifacts used but not declared
-
getUsedUndeclaredArtifactsWithUsages
public Map<org.apache.maven.artifact.Artifact,Set<DependencyUsage>> getUsedUndeclaredArtifactsWithUsages() -
getUnusedDeclaredArtifacts
Returns artifacts declared but not used.- Returns:
- artifacts declared but not used
-
getTestArtifactsWithNonTestScope
Returns artifacts only used in tests but not declared with test scope.- Returns:
- artifacts only used in tests but not declared with test scope
-
ignoreNonCompile
Filter non-compile scoped artifacts from unused declared.- Returns:
- updated project dependency analysis
- Since:
- 1.3
-
forceDeclaredDependenciesUsage
public ProjectDependencyAnalysis forceDeclaredDependenciesUsage(String[] forceUsedDependencies) throws ProjectDependencyAnalyzerException Force use status of some declared dependencies, to manually fix consequences of bytecode-level analysis which happens to not detect some effective use (constants, annotation with source-retention, javadoc).- Parameters:
forceUsedDependencies
- dependencies to move from "unused-declared" to "used-declared", withgroupId:artifactId
format- Returns:
- updated project dependency analysis
- Throws:
ProjectDependencyAnalyzerException
- if dependencies forced were either not declared or already detected as used- Since:
- 1.3
-
hashCode
public int hashCode()hashCode.
-
equals
-
toString
toString.
-