Interface ProjectDependencyAnalyzer
- All Known Implementing Classes:
DefaultProjectDependencyAnalyzer
public interface ProjectDependencyAnalyzer
Analyze a project's declared dependencies and effective classes used to find which artifacts are:
- used and declared,
- used but not declared,
- not used but declared.
- used but declared in too broad a scope
- Author:
- Mark Hobson
-
Method Summary
Modifier and TypeMethodDescriptiondefault ProjectDependencyAnalysisanalyze(org.apache.maven.project.MavenProject project) Analyzes the dependencies of a project.analyze(org.apache.maven.project.MavenProject project, Collection<String> excludedClasses) Analyzes the dependencies of a project, leaving out the classes that matchexcludedClassesboth in the project and in its dependencies.
-
Method Details
-
analyze
default ProjectDependencyAnalysis analyze(org.apache.maven.project.MavenProject project) throws ProjectDependencyAnalyzerException Analyzes the dependencies of a project. The project's main and test classes must be compiled and its dependencies resolved in the test scope.- Parameters:
project- the project to analyze- Returns:
- the analysis result
- Throws:
ProjectDependencyAnalyzerException- if the classes of the project or of a dependency cannot be read
-
analyze
ProjectDependencyAnalysis analyze(org.apache.maven.project.MavenProject project, Collection<String> excludedClasses) throws ProjectDependencyAnalyzerException Analyzes the dependencies of a project, leaving out the classes that matchexcludedClassesboth in the project and in its dependencies.- Parameters:
project- the project to analyzeexcludedClasses- regular expressions of class names to exclude, ornullfor none- Returns:
- the analysis result
- Throws:
ProjectDependencyAnalyzerException- if the classes of the project or of a dependency cannot be read
-