Interface IDependencyResolver

All Known Implementing Classes:
ResolveDependencies

public interface IDependencyResolver
  • Method Summary

    Modifier and Type
    Method
    Description
    Set<org.apache.maven.model.Dependency>
    getDependencies(boolean excludeCorrespondingGavs, InputStream... pomStreams)
    Calculate and return the dependencies of the maven artifacts loaded from the given InputStreams if excludeCorrespondingGavs is true then the returned dependencies will not include the resolved GAV's from the inputstreams.
    Set<org.apache.maven.model.Dependency>
    Calculate and return the dependencies of the maven project for which the inputstream of the pom file is given.
    Set<org.apache.maven.model.Dependency>
    Calculate and return the dependencies of the maven projects for which the inputstreams of the pom files are given.
    Set<org.apache.maven.model.Dependency>
    Calculate and return the dependencies of the maven artifacts with the given GAV's (GroupId, ArtifactId, Version).
    Set<org.apache.maven.model.Dependency>
    Calculate and return the dependencies of the maven artifacts with the given GAV's (GroupId, ArtifactId, Version).
    Set<org.apache.maven.model.Dependency>
    getDependencies(Stream<GAV> gavs, Collection<GAV> gavsToExclude)
    Calculate and return the dependencies of the maven artifacts with the given GAV's (GroupId, ArtifactId, Version).
    Set<org.apache.maven.model.Dependency>
    Calculate and return the dependencies of the maven artifact with the given GAV (GroupId, ArtifactId, Version).
    Set<org.apache.maven.model.Dependency>
    Calculate and return the dependencies of the maven artifacts with the given GAV's (GroupId, ArtifactId, Version).
    store(InputStream inputStream)
    Read the maven model from the given input stream and store it
    store(org.apache.maven.model.Model model)
    Store a single maven model
    default List<GAV>
    Store the given maven model input stream for later processing, inspect whether the maven project is a multi module project If so follow the modules and also store all child modules.
    storeMultiModule(InputStream inputStream, String relativePathOfGivenPomStream)
    Store the given maven model input stream for later processing, inspect whether the maven project is a multi module project If so follow the modules and also store all child modules.
    default List<GAV>
    storeMultiModule(org.apache.maven.model.Model model)
    Store the given maven model for later processing, inspect whether the maven project is a multi module project If so follow the modules and also store all child modules.
    storeMultiModule(org.apache.maven.model.Model model, String relativePathOfGivenPomModel)
    Store the given maven model input stream for later processing, inspect whether the maven project is a multi module project If so follow the modules and also store all child modules.
  • Method Details

    • store

      GAV store(org.apache.maven.model.Model model) throws RepositoryException
      Store a single maven model
      Parameters:
      model - The maven model to be stored
      Returns:
      the GAV of the stored maven model
      Throws:
      RepositoryException - thrown when there was an issue storing the maven model
    • store

      GAV store(InputStream inputStream) throws RepositoryException
      Read the maven model from the given input stream and store it
      Parameters:
      inputStream - The inputstream for the maven module to be stored
      Returns:
      the GAV of the stored maven model
      Throws:
      RepositoryException - thrown when there was an issue storing the maven model
    • storeMultiModule

      List<GAV> storeMultiModule(InputStream inputStream, String relativePathOfGivenPomStream) throws RepositoryException
      Store the given maven model input stream for later processing, inspect whether the maven project is a multi module project If so follow the modules and also store all child modules. Use the relative path to identify the relative locations of the modules. If the maven project is not a multi module project, then still store it, in that case the relative path can be empty or null
      Parameters:
      inputStream - The inputstream to the parent pom file
      relativePathOfGivenPomStream - The relative path where the pom files for the child modules can be found
      Returns:
      Return the GAV of the root project as first element of the returned list and the GAV's of all modules as subsequent elements in the returned list
      Throws:
      RepositoryException - thrown when there was an issue storing the maven model
    • storeMultiModule

      default List<GAV> storeMultiModule(InputStream inputStream) throws RepositoryException
      Store the given maven model input stream for later processing, inspect whether the maven project is a multi module project If so follow the modules and also store all child modules. Assume the pom was found at the root so no relative path is required. If the maven project is not a multi module project, then still store it, in that case the relative path can be empty or null
      Parameters:
      inputStream - The inputstream to the parent pom file
      Returns:
      Return the GAV of the root project as first element of the returned list and the GAV's of all modules as subsequent elements in the returned list
      Throws:
      RepositoryException - thrown when there was an issue storing the maven model
    • storeMultiModule

      List<GAV> storeMultiModule(org.apache.maven.model.Model model, String relativePathOfGivenPomModel) throws RepositoryException
      Store the given maven model input stream for later processing, inspect whether the maven project is a multi module project If so follow the modules and also store all child modules. Use the relative path to identify the relative locations of the modules. If the maven project is not a multi module project, then still store it, in that case the relative path can be empty or null
      Parameters:
      model - The parent maven model of the multi module project to be stored
      relativePathOfGivenPomModel - The relative path where the child modules can be found
      Returns:
      List Return the GAV of the root project as first element of the returned list and the GAV's of all modules as subsequent elements in the returned list
      Throws:
      RepositoryException - thrown when there was an issue storing the maven model
    • storeMultiModule

      default List<GAV> storeMultiModule(org.apache.maven.model.Model model) throws RepositoryException
      Store the given maven model for later processing, inspect whether the maven project is a multi module project If so follow the modules and also store all child modules. Assume the pom was found at the root so no relative path is required. If the maven project is not a multi module project, then still store it, in that case the relative path can be empty or null
      Parameters:
      model - The parent maven model of the multi module project to be stored
      Returns:
      Return the GAV of the root project as first element of the returned list and the GAV's of all modules as subsequent elements in the returned list
      Throws:
      RepositoryException - thrown when there was an issue storing the maven model
    • getDependencies

      Set<org.apache.maven.model.Dependency> getDependencies(GAV gav) throws RepositoryException, DepencyResolvingException
      Calculate and return the dependencies of the maven artifact with the given GAV (GroupId, ArtifactId, Version). The given GAV can be of a maven project that was previously stored or of a maven project that is known in the configured central repository e.g. maven central
      Parameters:
      gav - The Groupid-Artifactid-Version for which the dependencies need to be resolved
      Returns:
      Set of found dependencies
      Throws:
      RepositoryException - thrown when there was an issue storing the maven model
      DepencyResolvingException - thrown when there was an issue obtaining the list of dependencies
    • getDependencies

      Set<org.apache.maven.model.Dependency> getDependencies(InputStream... pomStreams) throws RepositoryException, DepencyResolvingException
      Calculate and return the dependencies of the maven projects for which the inputstreams of the pom files are given. The operation is the same as first using the store and then the getDependency method with the GAV of the stored maven model
      Parameters:
      pomStreams - Inputstreams to the pom files for which dependencies will be resolved
      Returns:
      Set The identified dependencies
      Throws:
      RepositoryException - thrown when there was an issue storing the maven model
      DepencyResolvingException - thrown when there was an issue obtaining the list of dependencies
    • getDependencies

      Set<org.apache.maven.model.Dependency> getDependencies(InputStream pomStream) throws RepositoryException, DepencyResolvingException
      Calculate and return the dependencies of the maven project for which the inputstream of the pom file is given. The operation is the same as first using the store and then the getDependency method with the GAV of the stored maven model
      Parameters:
      pomStream - Stream to the pom file for which dependencies will be resolved
      Returns:
      Set The identified dependencies
      Throws:
      RepositoryException - thrown when there was an issue storing the maven model
      DepencyResolvingException - thrown when there was an issue obtaining the list of dependencies
    • getDependencies

      Set<org.apache.maven.model.Dependency> getDependencies(GAV... gavs) throws DepencyResolvingException
      Calculate and return the dependencies of the maven artifacts with the given GAV's (GroupId, ArtifactId, Version). The given GAV's can be of maven projects that were previously stored or of maven projects that are known in the configured central repository e.g. maven central
      Parameters:
      gavs - List of Groupid-Artifact-Versions for which the dependencies will be resolved
      Returns:
      Set The identified dependencies
      Throws:
      DepencyResolvingException - thrown when there was an issue obtaining the list of dependencies
    • getDependencies

      Set<org.apache.maven.model.Dependency> getDependencies(Collection<GAV> gavs) throws DepencyResolvingException
      Calculate and return the dependencies of the maven artifacts with the given GAV's (GroupId, ArtifactId, Version). The given GAV's can be of maven projects that were previously stored or of maven projects that are known in the configured central repository e.g. maven central
      Parameters:
      gavs - Collection of Groupid-Artifact-Versions for which the dependencies will be resolved
      Returns:
      Set The identified dependencies
      Throws:
      DepencyResolvingException - thrown when there was an issue obtaining the list of dependencies
    • getDependencies

      Set<org.apache.maven.model.Dependency> getDependencies(Stream<GAV> gavs) throws DepencyResolvingException
      Calculate and return the dependencies of the maven artifacts with the given GAV's (GroupId, ArtifactId, Version). The given GAV's can be of maven projects that were previously stored or of maven projects that are known in the configured central repository e.g. maven central
      Parameters:
      gavs - Stream of Groupid-Artifact-Versions for which the dependencies will be resolved
      Returns:
      Set The identified dependencies
      Throws:
      DepencyResolvingException - thrown when there was an issue obtaining the list of dependencies
    • getDependencies

      Set<org.apache.maven.model.Dependency> getDependencies(boolean excludeCorrespondingGavs, InputStream... pomStreams) throws DepencyResolvingException
      Calculate and return the dependencies of the maven artifacts loaded from the given InputStreams if excludeCorrespondingGavs is true then the returned dependencies will not include the resolved GAV's from the inputstreams. This can be handy if you want to exclude the the modules dependencies in a multi module project
      Parameters:
      excludeCorrespondingGavs - exclude the dependencies corresponding to the given maven projects from the result
      pomStreams - Inputstreams to the pom files for which dependencies will be resolved
      Returns:
      Set The identified dependencies
      Throws:
      DepencyResolvingException - thrown when there was an issue obtaining the list of dependencies
    • getDependencies

      Set<org.apache.maven.model.Dependency> getDependencies(Stream<GAV> gavs, Collection<GAV> gavsToExclude) throws DepencyResolvingException
      Calculate and return the dependencies of the maven artifacts with the given GAV's (GroupId, ArtifactId, Version). The given GAV's can be of maven projects that were previously stored or of maven projects that are known in the configured central repository e.g. maven central Exclude from the result the GAVs that are given in gavsToExclude
      Parameters:
      gavs - Stream of Groupid-Artifact-Versions for which the dependencies will be resolved
      gavsToExclude - Dependencies with GAV's listed in gavsToExclude will not be included in the result
      Returns:
      Set The identified dependencies
      Throws:
      DepencyResolvingException - thrown when there was an issue obtaining the list of dependencies