Package de.mnl.osgi.bnd.maven
Interface MavenResource
-
- All Known Implementing Classes:
MavenResourceRepository.MavenResourceImpl
public interface MavenResource
A resource that is backed by a maven archive.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description aQute.maven.api.Archive
archive()
Returns the archive.Resource
asResource()
Gets the underlying "ordinary" resource.BoundArchive
boundArchive()
Returns the bound archive.List<org.apache.maven.model.Dependency>
dependencies()
Returns the mandatory maven compile and runtime dependencies.boolean
equals(Object obj)
Compares aMavenResource
with another maven resource or aResource
.List<Capability>
getCapabilities(String namespace)
Gets the capabilities from the given namespace.List<Requirement>
getRequirements(String namespace)
Gets the requirements from the given namespace.int
hashCode()
The hash code is defined by the revision.String
toString()
-
-
-
Method Detail
-
archive
aQute.maven.api.Archive archive()
Returns the archive. The archive is the only mandatory information when creating aMavenResource
. The other informations that can be obtained can be made available lazily, i.e. can be loaded on demand.This implies that a
MavenResource
can be created that does not exist in the backing maven repositories. If not obvious from the context, a call toboundArchive()
can be used to verify that the resource exists.- Returns:
- the archive
-
boundArchive
BoundArchive boundArchive() throws MavenResourceException
Returns the bound archive. Implies looking up the archive in the backing repositories.- Returns:
- the bound archive
- Throws:
MavenResourceException
- if the archive cannot obtained from a repository
-
dependencies
List<org.apache.maven.model.Dependency> dependencies() throws MavenResourceException
Returns the mandatory maven compile and runtime dependencies. Dependencies in the POM that use variables are filtered, because these variable cannot be resolved.- Returns:
- the dependencies
- Throws:
MavenResourceException
- the maven resource exception
-
asResource
Resource asResource() throws MavenResourceException
Gets the underlying "ordinary" resource.- Returns:
- the resource
- Throws:
MavenResourceException
- the maven resource exception
-
getCapabilities
List<Capability> getCapabilities(String namespace) throws MavenResourceException
Gets the capabilities from the given namespace.- Parameters:
namespace
- the namespace- Returns:
- the capabilities
- Throws:
MavenResourceException
- the maven resource exception
-
getRequirements
List<Requirement> getRequirements(String namespace) throws MavenResourceException
Gets the requirements from the given namespace.- Parameters:
namespace
- the namespace- Returns:
- the requirements
- Throws:
MavenResourceException
- the maven resource exception
-
equals
boolean equals(Object obj)
Compares aMavenResource
with another maven resource or aResource
.Two
MavenResource
s are considered equal if their archives are equal. If aMavenResource
is compared with anotherResource
, equality will be checked betweenasResource()
and the other resource (seeResource.equals(Object)
).
-
hashCode
int hashCode()
The hash code is defined by the revision.
-
-