Class MavenBundlesArtifactRepository
- java.lang.Object
-
- org.eclipse.core.runtime.PlatformObject
-
- org.eclipse.equinox.p2.repository.spi.AbstractRepository<org.eclipse.equinox.p2.metadata.IArtifactKey>
-
- org.eclipse.equinox.p2.repository.artifact.spi.AbstractArtifactRepository
-
- org.eclipse.tycho.repository.p2base.artifact.repository.AbstractArtifactRepository2
-
- org.eclipse.tycho.repository.p2base.artifact.repository.ArtifactRepositoryBaseImpl<GAVArtifactDescriptor>
-
- org.eclipse.tycho.p2.target.repository.MavenBundlesArtifactRepository
-
- All Implemented Interfaces:
org.eclipse.core.runtime.IAdaptable
,org.eclipse.equinox.p2.query.IQueryable<org.eclipse.equinox.p2.metadata.IArtifactKey>
,org.eclipse.equinox.p2.repository.artifact.IArtifactRepository
,org.eclipse.equinox.p2.repository.artifact.IFileArtifactRepository
,org.eclipse.equinox.p2.repository.IRepository<org.eclipse.equinox.p2.metadata.IArtifactKey>
,IArtifactFileProvider
,IArtifactProvider
,IRawArtifactFileProvider
,IRawArtifactProvider
public final class MavenBundlesArtifactRepository extends ArtifactRepositoryBaseImpl<GAVArtifactDescriptor>
p2 artifact repository providing the POM dependency Maven artifacts.Although the provided artifacts are also stored in the local Maven repository, they cannot be made available via the LocalArtifactRepository artifact repository implementation. The reason is that there are differences is how the artifacts provided by the respective implementations may be updated:
- For the LocalArtifactRepository artifacts, it can be assumed that all updates (e.g. as a result of a mvn install) are done by Tycho. Therefore it is safe to write the p2 artifact index data to disk together with the artifacts.
- For the POM dependency artifacts, this assumption does not hold true: e.g. a maven-bundle-plugin build may update an artifact in the local Maven repository without notifying Tycho. So if we had written p2 artifact index data to disk, that data might then be stale.
-
-
Field Summary
Fields Modifier and Type Field Description private MavenRepositorySystem
repositorySystem
-
Fields inherited from class org.eclipse.tycho.repository.p2base.artifact.repository.ArtifactRepositoryBaseImpl
descriptorsMap
-
-
Constructor Summary
Constructors Constructor Description MavenBundlesArtifactRepository(java.io.File localMavenRepositoryRoot, MavenRepositorySystem repositorySystem)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addPublishedArtifact(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor baseDescriptor, IArtifactFacade mavenArtifact)
java.io.File
getBaseDir()
protected org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor
getComparableDescriptor(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor descriptor)
Returns anIArtifactDescriptor
instance which is comparable to the artifact descriptors stored in the index (i.e.protected GAVArtifactDescriptor
getInternalDescriptorForAdding(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor descriptor)
Returns an artifact descriptor of the internal descriptor typeArtifactDescriptorT
which may be added to the index.protected java.io.File
internalGetArtifactStorageLocation(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor descriptor)
Returns the file system location where the given artifact is or would be stored.boolean
isFileAlreadyAvailable(org.eclipse.equinox.p2.metadata.IArtifactKey artifact)
private GAVArtifactDescriptor
toInternalDescriptor(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor descriptor)
-
Methods inherited from class org.eclipse.tycho.repository.p2base.artifact.repository.ArtifactRepositoryBaseImpl
contains, contains, descriptorQueryable, flattenedValues, getArtifact, getArtifact, getArtifactDescriptors, getArtifactFile, getArtifactFile, getRawArtifact, internalAddDescriptor, internalAddInternalDescriptor, internalNewAddingArtifactSink, internalRemoveAllDescriptors, internalRemoveDescriptor, internalRemoveDescriptors, internalRemoveDescriptors, internalRemoveDescriptors, internalStore, newAddingArtifactSink, newAddingRawArtifactSink, query
-
Methods inherited from class org.eclipse.tycho.repository.p2base.artifact.repository.AbstractArtifactRepository2
addDescriptor, addDescriptor, addDescriptors, addDescriptors, getArtifacts, getOutputStream, getRawArtifact, isFatal, removeAll, removeAll, removeDescriptor, removeDescriptor, removeDescriptor, removeDescriptor, removeDescriptors, removeDescriptors, removeDescriptors, removeDescriptors, setStatusOnStreamIfPossible
-
Methods inherited from class org.eclipse.equinox.p2.repository.artifact.spi.AbstractArtifactRepository
createArtifactDescriptor, createArtifactKey, equals, executeBatch, hashCode
-
Methods inherited from class org.eclipse.equinox.p2.repository.spi.AbstractRepository
assertModifiable, getDescription, getLocation, getName, getProperties, getProperty, getProvider, getProvisioningAgent, getType, getVersion, isModifiable, setDescription, setLocation, setName, setProperties, setProperty, setProperty, setProvider, setType, setVersion
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.eclipse.equinox.p2.repository.artifact.IArtifactRepository
addDescriptor, addDescriptor, addDescriptors, addDescriptors, createArtifactDescriptor, createArtifactKey, executeBatch, getArtifacts, getOutputStream, getRawArtifact, removeAll, removeAll, removeDescriptor, removeDescriptor, removeDescriptor, removeDescriptor, removeDescriptors, removeDescriptors, removeDescriptors, removeDescriptors
-
-
-
-
Field Detail
-
repositorySystem
private MavenRepositorySystem repositorySystem
-
-
Constructor Detail
-
MavenBundlesArtifactRepository
public MavenBundlesArtifactRepository(java.io.File localMavenRepositoryRoot, MavenRepositorySystem repositorySystem)
-
-
Method Detail
-
addPublishedArtifact
public void addPublishedArtifact(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor baseDescriptor, IArtifactFacade mavenArtifact)
-
getInternalDescriptorForAdding
protected GAVArtifactDescriptor getInternalDescriptorForAdding(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor descriptor)
Description copied from class:ArtifactRepositoryBaseImpl
Returns an artifact descriptor of the internal descriptor typeArtifactDescriptorT
which may be added to the index. Implementations may require that the descriptor argument is a descriptor instance created by this repository – seeAbstractArtifactRepository.createArtifactDescriptor(IArtifactKey)
.This method is called by methods that add entries to the index, i.e. from
ArtifactRepositoryBaseImpl.newAddingArtifactSink(IArtifactKey)
.- Specified by:
getInternalDescriptorForAdding
in classArtifactRepositoryBaseImpl<GAVArtifactDescriptor>
- Parameters:
descriptor
- AnIArtifactDescriptor
instance
-
getComparableDescriptor
protected org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor getComparableDescriptor(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor descriptor)
Description copied from class:ArtifactRepositoryBaseImpl
Returns anIArtifactDescriptor
instance which is comparable to the artifact descriptors stored in the index (i.e. theArtifactRepositoryBaseImpl.descriptorsMap
member). A valid implementation is to convert the argument to the internal descriptor typeArtifactDescriptorT
, but this is not a requirement. This method should be implemented in a way so that callingdescriptors.contains(getComparableDescriptor(foreignDescriptor))
with a descriptor from a foreign artifact repository returnstrue
if and only if copying that foreign artifact to this repository withAbstractArtifactRepository2.getOutputStream(IArtifactDescriptor)
would not add a new artifact to this repository.This method may be called by any API method with an
IArtifactDescriptor
argument.- Specified by:
getComparableDescriptor
in classArtifactRepositoryBaseImpl<GAVArtifactDescriptor>
- Parameters:
descriptor
- AnIArtifactDescriptor
from any artifact repository.
-
toInternalDescriptor
private GAVArtifactDescriptor toInternalDescriptor(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor descriptor)
-
internalGetArtifactStorageLocation
protected java.io.File internalGetArtifactStorageLocation(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor descriptor)
Description copied from class:ArtifactRepositoryBaseImpl
Returns the file system location where the given artifact is or would be stored. UnlikeArtifactRepositoryBaseImpl.getArtifactFile(IArtifactDescriptor)
, this method does not check if the given artifact exists in the repository and never returnsnull
.This method may be called by any API method for reading or writing artifacts.
- Specified by:
internalGetArtifactStorageLocation
in classArtifactRepositoryBaseImpl<GAVArtifactDescriptor>
-
getBaseDir
public java.io.File getBaseDir()
-
isFileAlreadyAvailable
public boolean isFileAlreadyAvailable(org.eclipse.equinox.p2.metadata.IArtifactKey artifact)
-
-