public class Dependencies extends Object
Constructor and Description |
---|
Dependencies(org.apache.maven.project.MavenProject project,
org.apache.maven.shared.dependency.graph.DependencyNode dependencyTreeNode,
org.apache.maven.shared.jar.classes.JarClassesAnalysis classesAnalyzer)
Default constructor
|
Modifier and Type | Method and Description |
---|---|
List<org.apache.maven.artifact.Artifact> |
getAllDependencies() |
Map<String,List<org.apache.maven.artifact.Artifact>> |
getDependenciesByScope(boolean isTransitively) |
File |
getFile(org.apache.maven.artifact.Artifact artifact)
get the artifact's file, with detection of target/classes directory with already packaged jar available.
|
org.apache.maven.shared.jar.JarData |
getJarDependencyDetails(org.apache.maven.artifact.Artifact artifact) |
org.apache.maven.project.MavenProject |
getProject()
Getter for the project
|
List<org.apache.maven.artifact.Artifact> |
getProjectDependencies() |
List<org.apache.maven.artifact.Artifact> |
getTransitiveDependencies() |
boolean |
hasDependencies() |
public Dependencies(org.apache.maven.project.MavenProject project, org.apache.maven.shared.dependency.graph.DependencyNode dependencyTreeNode, org.apache.maven.shared.jar.classes.JarClassesAnalysis classesAnalyzer)
project
- the MavenProject.dependencyTreeNode
- the DependencyNode.classesAnalyzer
- the JarClassesAnalysis.public org.apache.maven.project.MavenProject getProject()
public boolean hasDependencies()
true
if getProjectDependencies() is not empty, false
otherwise.public List<org.apache.maven.artifact.Artifact> getProjectDependencies()
Artifact
from the project.public List<org.apache.maven.artifact.Artifact> getTransitiveDependencies()
Artifact
from the project.public List<org.apache.maven.artifact.Artifact> getAllDependencies()
Artifact
returned by the dependency tree.public Map<String,List<org.apache.maven.artifact.Artifact>> getDependenciesByScope(boolean isTransitively)
isTransitively
- true
to return transitive dependencies, false
otherwise.Artifact
as values.Artifact.SCOPE_COMPILE
,
Artifact.SCOPE_PROVIDED
,
Artifact.SCOPE_RUNTIME
,
Artifact.SCOPE_SYSTEM
,
Artifact.SCOPE_TEST
public org.apache.maven.shared.jar.JarData getJarDependencyDetails(org.apache.maven.artifact.Artifact artifact) throws IOException
artifact
- the artifact.IOException
- if anypublic File getFile(org.apache.maven.artifact.Artifact artifact)
artifact
- the artifact to retrieve the physical fileCopyright © 2005–2024 The Apache Software Foundation. All rights reserved.