Class MavenDependencyCollector

java.lang.Object
io.github.mmm.code.impl.java.source.maven.MavenDependencyCollector

public class MavenDependencyCollector extends Object
Class to collect dependencies of a maven project.
Since:
1.0.0
See Also:
  • Constructor Details

    • MavenDependencyCollector

      public MavenDependencyCollector(boolean includeTestDependencies, boolean buildReactor, String altBuildDir)
      The constructor.
      Parameters:
      includeTestDependencies - - true to include test-dependencies, false otherwise.
      buildReactor - - true to build the maven project reactor by traversing all parents and modules to resolve dependencies to sibling modules (slower but more accurate), false otherwise.
      altBuildDir - the alternative build directory (e.g. "eclipse-target").
    • MavenDependencyCollector

      public MavenDependencyCollector(MavenBridge mavenBridge, boolean includeTestDependencies, boolean buildReactor, String altBuildDir)
      The constructor.
      Parameters:
      mavenBridge - the MavenBridge instance to use.
      includeTestDependencies - - true to include test-dependencies, false otherwise.
      buildReactor - - true to build the maven project reactor by traversing all parents and modules to resolve dependencies to sibling modules (slower but more accurate), false otherwise.
      altBuildDir - the alternative build directory (e.g. "eclipse-target").
  • Method Details

    • asUrls

      public URL[] asUrls()
      Returns:
      the collected dependencies as URLs.
    • asClassLoader

      public ClassLoader asClassLoader()
      Returns:
      a ClassLoader for the collected dependencies.
    • asClassLoader

      public ClassLoader asClassLoader(ClassLoader parent)
      Parameters:
      parent - the parent ClassLoader.
      Returns:
      a ClassLoader for 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