Class MavenDependencyCollector
java.lang.Object
io.github.mmm.code.impl.java.source.maven.MavenDependencyCollector
Class to collect
dependencies of a maven project.- Since:
- 1.0.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionMavenDependencyCollector(boolean includeTestDependencies, boolean buildReactor, String altBuildDir) The constructor.MavenDependencyCollector(MavenBridge mavenBridge, boolean includeTestDependencies, boolean buildReactor, String altBuildDir) The constructor. -
Method Summary
Modifier and TypeMethodDescriptionasClassLoader(ClassLoader parent) URL[]asUrls()voidcollect(org.apache.maven.model.Model model) Resolves and collects the dependencies of a local maven project.
-
Constructor Details
-
MavenDependencyCollector
public MavenDependencyCollector(boolean includeTestDependencies, boolean buildReactor, String altBuildDir) The constructor.- Parameters:
includeTestDependencies- -trueto include test-dependencies,falseotherwise.buildReactor- -trueto build the maven project reactor by traversing all parents and modules to resolve dependencies to sibling modules (slower but more accurate),falseotherwise.altBuildDir- the alternative build directory (e.g. "eclipse-target").
-
MavenDependencyCollector
public MavenDependencyCollector(MavenBridge mavenBridge, boolean includeTestDependencies, boolean buildReactor, String altBuildDir) The constructor.- Parameters:
mavenBridge- theMavenBridgeinstance to use.includeTestDependencies- -trueto include test-dependencies,falseotherwise.buildReactor- -trueto build the maven project reactor by traversing all parents and modules to resolve dependencies to sibling modules (slower but more accurate),falseotherwise.altBuildDir- the alternative build directory (e.g. "eclipse-target").
-
-
Method Details
-
asUrls
- Returns:
- the collected dependencies as
URLs.
-
asClassLoader
- Returns:
- a
ClassLoaderfor the collected dependencies.
-
asClassLoader
- Parameters:
parent- the parentClassLoader.- Returns:
- a
ClassLoaderfor the collected dependencies.
-
collect
public void collect(org.apache.maven.model.Model model) Resolves and collects the dependencies of a local maven project.- Parameters:
model- parsed from the POM of a project
-