Package aQute.maven.provider
Class MavenRepository
java.lang.Object
aQute.maven.provider.MavenRepository
- All Implemented Interfaces:
IMavenRepo,Closeable,AutoCloseable
-
Field Summary
Fields inherited from interface aQute.maven.api.IMavenRepo
ARCHIVE_P -
Constructor Summary
ConstructorsConstructorDescriptionMavenRepository(File base, String id, List<MavenBackingRepository> release, MavenBackingRepository stagingRepository, List<MavenBackingRepository> snapshot, Executor executor, aQute.service.reporter.Reporter reporter) MavenRepository(File base, String id, List<MavenBackingRepository> release, List<MavenBackingRepository> snapshot, Executor executor, aQute.service.reporter.Reporter reporter) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidclose()booleanorg.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.voidstore(Archive archive, InputStream in) toLocalFile(Archive archive) Get the file object for the archive.toLocalFile(String path) toRemoteURI(Archive archive) Get the URI to the remote archivetoString()
-
Constructor Details
-
MavenRepository
public MavenRepository(File base, String id, List<MavenBackingRepository> release, List<MavenBackingRepository> snapshot, Executor executor, aQute.service.reporter.Reporter reporter) throws Exception - Throws:
Exception
-
MavenRepository
public MavenRepository(File base, String id, List<MavenBackingRepository> release, MavenBackingRepository stagingRepository, List<MavenBackingRepository> snapshot, Executor executor, aQute.service.reporter.Reporter reporter) throws Exception - Throws:
Exception
-
-
Method Details
-
getRevisions
Description copied from interface:IMavenRepoGet 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.- Specified by:
getRevisionsin interfaceIMavenRepo- Parameters:
program- the program to list the revisions for- Returns:
- a list of revisions in the repository
- Throws:
Exception
-
getSnapshotArchives
Description copied from interface:IMavenRepoList the snapshot archives for a given revision. If the revision is not a snapshot, the list will be empty- Specified by:
getSnapshotArchivesin interfaceIMavenRepo- Parameters:
revision- the revisions to list from- Returns:
- the list snapshot archives
- Throws:
Exception
-
getResolvedArchive
public Archive getResolvedArchive(Revision revision, String extension, String classifier) throws Exception Description copied from interface:IMavenRepoFor a given snapshot revision, get the latest resolved archive.- Specified by:
getResolvedArchivein interfaceIMavenRepo- 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
-
release
Description copied from interface:IMavenRepoCreate a release object to release the revision.- Specified by:
releasein interfaceIMavenRepo- Parameters:
revision- the revision to release- Returns:
- the Release object
- Throws:
Exception
-
get
Description copied from interface:IMavenRepoGet the file in the repositories local cache directory.- Specified by:
getin interfaceIMavenRepo- Parameters:
archive- The archive to fetch- Returns:
- the file or null if not found
- Throws:
Exception
-
get
Description copied from interface:IMavenRepoGet the file, refreshing snapshots when force is true.- Specified by:
getin interfaceIMavenRepo- Parameters:
archive- The archive to fetchforce- refresh snapshots- Returns:
- the file or null if not found
- Throws:
Exception
-
resolveSnapshot
Description copied from interface:IMavenRepoTake a generic snapshot archive and resolve it to the latest released snapshot.- Specified by:
resolveSnapshotin interfaceIMavenRepo- Parameters:
archive- the archive to resolve- Returns:
- the archive or null if not found
- Throws:
Exception
-
resolveSnapshot
Description copied from interface:IMavenRepoTake a generic snapshot archive and resolve it to the latest released snapshot, refresh the metadata if force is true.- Specified by:
resolveSnapshotin interfaceIMavenRepo- Parameters:
archive- the archive to resolveforce- if true, refresh the metadata- Returns:
- the archive or null if not found
- Throws:
Exception
-
toLocalFile
-
toLocalFile
Description copied from interface:IMavenRepoGet the file object for the archive. The file does not have to exist- Specified by:
toLocalFilein interfaceIMavenRepo- Parameters:
archive- the archive to find the file for- Returns:
- the File or null if not found
-
getLastUpdated
Description copied from interface:IMavenRepoGet the last updated time for a snapshot revision.- Specified by:
getLastUpdatedin interfaceIMavenRepo- Parameters:
revision- the snapshot revision to get the time from- Returns:
- the time of the snapshot revision remote update
- Throws:
Exception
-
getArchive
Description copied from interface:IMavenRepoGet the archive from the repository. Syntax:s = group ':' artifact (':' extension ( ':' classifier )?)? ':' version- Specified by:
getArchivein interfaceIMavenRepo- Parameters:
s- the archive specified as string- Throws:
Exception
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
toRemoteURI
Description copied from interface:IMavenRepoGet the URI to the remote archive- Specified by:
toRemoteURIin interfaceIMavenRepo- Parameters:
archive- the archive to calculate the URI for- Returns:
- the URI for the given archive
- Throws:
Exception
-
store
- Throws:
IOException
-
refresh
Description copied from interface:IMavenRepoRefresh snapshot metadata so snapshots are retrieved again- Specified by:
refreshin interfaceIMavenRepo- Throws:
IOException
-
toString
-
getName
Description copied from interface:IMavenRepoGet the name of this repository- Specified by:
getNamein interfaceIMavenRepo- Returns:
- the name
-
getPom
- Specified by:
getPomin interfaceIMavenRepo- Throws:
Exception
-
getPom
- Specified by:
getPomin interfaceIMavenRepo- Throws:
Exception
-
getSnapshotRepositories
- Specified by:
getSnapshotRepositoriesin interfaceIMavenRepo
-
getReleaseRepositories
- Specified by:
getReleaseRepositoriesin interfaceIMavenRepo
-
isLocalOnly
public boolean isLocalOnly()- Specified by:
isLocalOnlyin interfaceIMavenRepo
-
exists
- Specified by:
existsin interfaceIMavenRepo- Throws:
Exception
-
clear
-