Package de.mnl.osgi.bnd.maven
Class MavenResourceRepository
- java.lang.Object
-
- de.mnl.osgi.bnd.maven.CompositeMavenRepository
-
- de.mnl.osgi.bnd.maven.MavenResourceRepository
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public class MavenResourceRepository extends CompositeMavenRepository
Wraps the artifacts from a maven repository asResources.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classMavenResourceRepository.MavenResourceImplA maven resource that obtains its information lazily from aCompositeMavenRepository.-
Nested classes/interfaces inherited from class de.mnl.osgi.bnd.maven.CompositeMavenRepository
CompositeMavenRepository.BinaryLocation
-
-
Field Summary
Fields Modifier and Type Field Description static StringMAVEN_DEPENDENCIES_NSThe namespace used to store the maven dependencies information.-
Fields inherited from class de.mnl.osgi.bnd.maven.CompositeMavenRepository
COORDS_SPLITTER
-
-
Constructor Summary
Constructors Constructor Description MavenResourceRepository(File base, String repoId, List<aQute.maven.provider.MavenBackingRepository> releaseRepos, List<aQute.maven.provider.MavenBackingRepository> snapshotRepos, Executor executor, aQute.service.reporter.Reporter reporter)Instantiates a new maven resource repository.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidreset()Reset any cached information.Optional<MavenResource>resource(aQute.maven.api.Program program, MavenVersionSpecification version, String extension, String classifier, CompositeMavenRepository.BinaryLocation location)Creates aMavenResourcefor the given program and version.MavenResourceresource(BoundArchive archive, CompositeMavenRepository.BinaryLocation location)Creates aMavenResourcefor the given archive.MavenResourceRepositorysetResourceSupplier(Function<aQute.maven.api.Archive,Optional<Resource>> resourceSupplier)Sets a function that can provide resource information more efficiently (e.g.-
Methods inherited from class de.mnl.osgi.bnd.maven.CompositeMavenRepository
backing, backingAsStream, close, find, find, find, findRevisions, get, model, name, refreshSnapshot, resolve, retrieve, toLocalFile
-
-
-
-
Field Detail
-
MAVEN_DEPENDENCIES_NS
public static final String MAVEN_DEPENDENCIES_NS
The namespace used to store the maven dependencies information.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MavenResourceRepository
public MavenResourceRepository(File base, String repoId, List<aQute.maven.provider.MavenBackingRepository> releaseRepos, List<aQute.maven.provider.MavenBackingRepository> snapshotRepos, Executor executor, aQute.service.reporter.Reporter reporter) throws Exception
Instantiates a new maven resource repository.- Parameters:
base- the baserepoId- the repo idreleaseRepos- the release repossnapshotRepos- the snapshot reposexecutor- the executorreporter- the reporter- Throws:
Exception- the exception
-
-
Method Detail
-
reset
public void reset()
Description copied from class:CompositeMavenRepositoryReset any cached information.- Overrides:
resetin classCompositeMavenRepository
-
setResourceSupplier
public MavenResourceRepository setResourceSupplier(Function<aQute.maven.api.Archive,Optional<Resource>> resourceSupplier)
Sets a function that can provide resource information more efficiently (e.g. from some local persistent cache) than the remote maven repository.Any resource information provided by the function must be complete, i.e. must hold the information from the "bnd.info" namespace and from the "maven.dependencies.info" namespace.
- Parameters:
resourceSupplier- the resource supplier- Returns:
- the composite maven repository
-
resource
public Optional<MavenResource> resource(aQute.maven.api.Program program, MavenVersionSpecification version, String extension, String classifier, CompositeMavenRepository.BinaryLocation location)
Creates aMavenResourcefor the given program and version.- Parameters:
program- the programversion- the versionextension- the extension (ornullfor "jar")classifier- the classifier (ornullfor "")location- which URL to use for the binary in theResource- Returns:
- the resource
-
resource
public MavenResource resource(BoundArchive archive, CompositeMavenRepository.BinaryLocation location)
Creates aMavenResourcefor the given archive.- Parameters:
archive- the archivelocation- which URL to use for the binary in theResource- Returns:
- the resource
-
-