Class MvnRepoLookup

java.lang.Object
org.jdrupes.builder.core.AbstractProvider
org.jdrupes.builder.mvnrepo.MvnRepoLookup
All Implemented Interfaces:
ResourceProvider

public class MvnRepoLookup extends AbstractProvider implements ResourceProvider

Depending on the request, this provider provides two types of resources.

  1. The artifacts to be resolved as CompilationResources<MavenRepoDependencies>. The artifacts to be resolved are those added with resolve(org.jdrupes.builder.mvnrepo.MvnRepoDependency.Scope,java.lang.String...).

  2. The CompilationResources<LibraryJarFile> or RuntimeResources<LibraryJarFile> (depending on the request) that result from resolving the artifacts to be resolved. The resources returned implement the additional marker interface MvnRepoJarFile.

  • Constructor Details

    • MvnRepoLookup

      public MvnRepoLookup()
      Instantiates a new mvn repo lookup.
  • Method Details

    • snapshotRepository

      Sets the Maven snapshot repository URI.
      Parameters:
      uri - the snapshot repository URI
      Returns:
      the mvn repo lookup
    • snapshotRepository

      Returns the snapshot repository. Defaults to https://central.sonatype.com/repository/maven-snapshots/.
      Returns:
      the uri
    • resolve

      public MvnRepoLookup resolve(MvnRepoDependency.Scope scope, String... coordinates)
      Add artifacts, specified by their coordinates (groupId:artifactId:version) with the given scope.
      Parameters:
      scope - the scope
      coordinates - the coordinates
      Returns:
      the mvn repo lookup
    • resolve

      public MvnRepoLookup resolve(String... coordinates)
      Add artifacts, specified by their coordinates (groupId:artifactId:version) as compilation resources.
      Parameters:
      coordinates - the coordinates
      Returns:
      the mvn repo lookup
    • downloadSources

      public MvnRepoLookup downloadSources(boolean enable)
      Whether to also download the sources. Defaults to true.
      Parameters:
      enable - the enable
      Returns:
      the mvn repo lookup
    • downloadJavadoc

      public MvnRepoLookup downloadJavadoc(boolean enable)
      Whether to also download the javadoc. Defaults to true.
      Parameters:
      enable - the enable
      Returns:
      the mvn repo lookup
    • doProvide

      protected <T extends Resource> Stream<T> doProvide(ResourceRequest<T> requested)
      Provide.
      Specified by:
      doProvide in class AbstractProvider
      Type Parameters:
      T - the generic type
      Parameters:
      requested - the requested resources
      Returns:
      the stream