Class ProjectDependencyAnalysis
- java.lang.Object
-
- org.apache.maven.shared.dependency.analyzer.ProjectDependencyAnalysis
-
public class ProjectDependencyAnalysis extends Object
Project dependencies analysis result.- Version:
- $Id$
- Author:
- Mark Hobson
-
-
Constructor Summary
Constructors Constructor Description ProjectDependencyAnalysis()ProjectDependencyAnalysis(Set<org.apache.maven.artifact.Artifact> usedDeclaredArtifacts, Set<org.apache.maven.artifact.Artifact> usedUndeclaredArtifacts, Set<org.apache.maven.artifact.Artifact> unusedDeclaredArtifacts)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)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object object)ProjectDependencyAnalysisforceDeclaredDependenciesUsage(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>getTestArtifactsWithNonTestScope()Test Artifacts that have a non-test scopeSet<org.apache.maven.artifact.Artifact>getUnusedDeclaredArtifacts()Unused but declared artifacts.Set<org.apache.maven.artifact.Artifact>getUsedDeclaredArtifacts()Used and declared artifacts.Set<org.apache.maven.artifact.Artifact>getUsedUndeclaredArtifacts()Used but not declared artifacts.inthashCode()ProjectDependencyAnalysisignoreNonCompile()Filter not-compile scoped artifacts from unused declared.StringtoString()
-
-
-
Constructor Detail
-
ProjectDependencyAnalysis
public 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)
-
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)
-
-
Method Detail
-
getUsedDeclaredArtifacts
public Set<org.apache.maven.artifact.Artifact> getUsedDeclaredArtifacts()
Used and declared artifacts.- Returns:
Artifact
-
getUsedUndeclaredArtifacts
public Set<org.apache.maven.artifact.Artifact> getUsedUndeclaredArtifacts()
Used but not declared artifacts.- Returns:
Artifact
-
getUnusedDeclaredArtifacts
public Set<org.apache.maven.artifact.Artifact> getUnusedDeclaredArtifacts()
Unused but declared artifacts.- Returns:
Artifact
-
getTestArtifactsWithNonTestScope
public Set<org.apache.maven.artifact.Artifact> getTestArtifactsWithNonTestScope()
Test Artifacts that have a non-test scope- Returns:
Artifact
-
ignoreNonCompile
public ProjectDependencyAnalysis ignoreNonCompile()
Filter not-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:artifactIdformat- Returns:
- updated project dependency analysis
- Throws:
ProjectDependencyAnalyzerException- if dependencies forced were either not declared or already detected as used- Since:
- 1.3
-
-