Class MvnRepoLookup
- All Implemented Interfaces:
ResourceProvider
Depending on the request, this provider provides two types of resources.
-
The artifacts to be resolved as
Resources<MvnRepoDependency>. The artifacts to be resolved are those added withresolve(java.lang.String...). Note that the result also includes theMvnRepoBoms. -
The
CompilationResources<LibraryJarFile>orRuntimeResources<LibraryJarFile>(depending on the request) that result from resolving the artifacts to be resolved. The resources returned implement the additional marker interfaceMvnRepoJarFile.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdd a bill of materials.doProvide(ResourceRequest<T> requested) Provide.downloadJavadoc(boolean enable) Whether to also download the javadoc.downloadSources(boolean enable) Whether to also download the sources.probe()Failing to resolve the dependencies normally results in aBuildException, because the requested artifacts are assumed to be required for the built.Add artifacts, specified by their coordinates (groupId:artifactId:version) as resources.resolve(Stream<? extends MvnRepoResource> resources) Add artifacts.Returns the snapshot repository.snapshotRepository(URI uri) Sets the Maven snapshot repository URI.Methods inherited from class AbstractProvider
context, name, newResource, of, rename, toString, vavrStream
-
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 tohttps://central.sonatype.com/repository/maven-snapshots/.- Returns:
- the uri
-
bom
Add a bill of materials. The coordinates are resolved as a dependency with scopeimportwhich is added to thedependencyManagementsection.- Parameters:
coordinates- the coordinates- Returns:
- the mvn repo lookup
-
resolve
Add artifacts, specified by their coordinates (groupId:artifactId:version) as resources.- Parameters:
coordinates- the coordinates- Returns:
- the mvn repo lookup
-
resolve
Add artifacts. The method handlesMvnRepoBoms correctly.- Parameters:
resources- the resources- Returns:
- the mvn repo lookup
-
probe
Failing to resolve the dependencies normally results in a
BuildException, because the requested artifacts are assumed to be required for the built.By invoking this method the provider enters probe mode and returns an empty result stream instead of throwing an exception if the resolution fails.
- Returns:
- the mvn repo lookup
-
downloadSources
Whether to also download the sources. Defaults totrue.- Parameters:
enable- the enable- Returns:
- the mvn repo lookup
-
downloadJavadoc
Whether to also download the javadoc. Defaults totrue.- Parameters:
enable- the enable- Returns:
- the mvn repo lookup
-
doProvide
Provide.- Specified by:
doProvidein classAbstractProvider- Type Parameters:
T- the generic type- Parameters:
requested- the requested resources- Returns:
- the stream
-