Package aQute.maven.api
Interface IMavenRepo
- All Superinterfaces:
AutoCloseable,Closeable
- All Known Implementing Classes:
MavenRepository
This is an abstraction of a Maven repository. It is a repository backed by a
local directory (usually ~/.m2/repository) and a remote release and/or
snapshot repository that is accessed over http(s).
The repository stores archives organized in revisions. Revisions are organized in programs. Archives are the files created per revision, they are distinguished by extension and classifier.
Maven maintains the remote snapshots with date stamped archives. (The SNAPSHOT is replaced with a date stamp + build number). This repository can resolve the latest archive and provide a list of date stamped archives.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbooleanorg.osgi.util.promise.Promise<File>Get the file in the repositories local cache directory.org.osgi.util.promise.Promise<File>Get the file, refreshing snapshots when force is true.getArchive(String s) Get the archive from the repository.longgetLastUpdated(Revision revision) Get the last updated time for a snapshot revision.getName()Get the name of this repositorygetPom(InputStream pomFile) getResolvedArchive(Revision revision, String extension, String classifier) For a given snapshot revision, get the latest resolved archive.getRevisions(Program program) Get the revisions that belong to a program.getSnapshotArchives(Revision revision) List the snapshot archives for a given revision.booleanbooleanrefresh()Refresh snapshot metadata so snapshots are retrieved againrelease(Revision revision, Properties context) Create a release object to release the revision.resolveSnapshot(Archive archive) Take a generic snapshot archive and resolve it to the latest released snapshot.resolveSnapshot(Archive archive, boolean force) Take a generic snapshot archive and resolve it to the latest released snapshot, refresh the metadata if force is true.toLocalFile(Archive archive) Get the file object for the archive.toRemoteURI(Archive archive) Get the URI to the remote archive
-
Field Details
-
ARCHIVE_P
The format for an archive is:group ':' artifact ( ':' extension ( ':' classifier )? )? ':' version ( '-SNAPSHOT' )?
-
-
Method Details
-
getArchive
Get the archive from the repository. Syntax:s = group ':' artifact (':' extension ( ':' classifier )?)? ':' version- Parameters:
s- the archive specified as string- Throws:
Exception
-
getRevisions
Get the revisions that belong to a program. This uses themaven-metadata-xmlfile in the program directory on the remote repository (release + snapshot). For a local only repository this must return an empty list.- Parameters:
program- the program to list the revisions for- Returns:
- a list of revisions in the repository
- Throws:
Exception
-
getSnapshotArchives
List the snapshot archives for a given revision. If the revision is not a snapshot, the list will be empty- Parameters:
revision- the revisions to list from- Returns:
- the list snapshot archives
- Throws:
Exception
-
getResolvedArchive
For a given snapshot revision, get the latest resolved archive.- Parameters:
revision- the revision (MUST be snapshot)extension- the extension of the archiveclassifier- the classifier of the archive ( may be null)- Returns:
- the archive as resolved against the remote maven-metadata.xml for the revision
- Throws:
Exception
-
get
Get the file in the repositories local cache directory.- Parameters:
archive- The archive to fetch- Returns:
- the file or null if not found
- Throws:
Exception
-
get
Get the file, refreshing snapshots when force is true.- Parameters:
archive- The archive to fetchforce- refresh snapshots- Returns:
- the file or null if not found
- Throws:
Exception
-
getLastUpdated
Get the last updated time for a snapshot revision.- Parameters:
revision- the snapshot revision to get the time from- Returns:
- the time of the snapshot revision remote update
- Throws:
Exception
-
release
Create a release object to release the revision.- Parameters:
revision- the revision to release- Returns:
- the Release object
- Throws:
Exception
-
resolveSnapshot
Take a generic snapshot archive and resolve it to the latest released snapshot.- Parameters:
archive- the archive to resolve- Returns:
- the archive or null if not found
- Throws:
Exception
-
resolveSnapshot
Take a generic snapshot archive and resolve it to the latest released snapshot, refresh the metadata if force is true.- Parameters:
archive- the archive to resolveforce- if true, refresh the metadata- Returns:
- the archive or null if not found
- Throws:
Exception
-
toLocalFile
Get the file object for the archive. The file does not have to exist- Parameters:
archive- the archive to find the file for- Returns:
- the File or null if not found
-
toRemoteURI
Get the URI to the remote archive- Parameters:
archive- the archive to calculate the URI for- Returns:
- the URI for the given archive
- Throws:
Exception
-
refresh
Refresh snapshot metadata so snapshots are retrieved again- Throws:
Exception
-
getName
String getName()Get the name of this repository- Returns:
- the name
-
getPom
- Throws:
Exception
-
getPom
- Throws:
Exception
-
getSnapshotRepositories
List<MavenBackingRepository> getSnapshotRepositories() -
getReleaseRepositories
List<MavenBackingRepository> getReleaseRepositories() -
isLocalOnly
boolean isLocalOnly() -
exists
- Throws:
Exception
-