Class MavenArtifactRepository
java.lang.Object
org.apache.maven.artifact.repository.MavenArtifactRepository
- All Implemented Interfaces:
ArtifactRepository
- Direct Known Subclasses:
DelegatingLocalArtifactRepository
,LocalArtifactRepository
Abstraction of an artifact repository. Artifact repositories can be remote, local, or even build reactor or
IDE workspace.
-
Constructor Summary
ConstructorDescriptionMavenArtifactRepository
(String id, String url, ArtifactRepositoryLayout layout, ArtifactRepositoryPolicy snapshots, ArtifactRepositoryPolicy releases) Create a remote download repository. -
Method Summary
Modifier and TypeMethodDescriptionprotected static <T> boolean
eq
(T s1, T s2) boolean
findVersions
(Artifact artifact) Finds the versions of the specified artifact that are available in this repository.getId()
getKey()
getProxy()
getUrl()
int
hashCode()
boolean
boolean
boolean
Indicates whether this repository is backed by actual projects.boolean
pathOfLocalRepositoryMetadata
(ArtifactMetadata metadata, ArtifactRepository repository) pathOfRemoteRepositoryMetadata
(ArtifactMetadata artifactMetadata) void
setAuthentication
(Authentication authentication) void
setBlacklisted
(boolean blackListed) void
setBlocked
(boolean blocked) void
void
setLayout
(ArtifactRepositoryLayout layout) void
setMirroredRepositories
(List<ArtifactRepository> mirroredRepositories) void
void
void
setSnapshotUpdatePolicy
(ArtifactRepositoryPolicy snapshots) void
toString()
-
Constructor Details
-
MavenArtifactRepository
public MavenArtifactRepository() -
MavenArtifactRepository
public MavenArtifactRepository(String id, String url, ArtifactRepositoryLayout layout, ArtifactRepositoryPolicy snapshots, ArtifactRepositoryPolicy releases) Create a remote download repository.- Parameters:
id
- the unique identifier of the repositoryurl
- the URL of the repositorylayout
- the layout of the repositorysnapshots
- the policies to use for snapshotsreleases
- the policies to use for releases
-
-
Method Details
-
pathOf
- Specified by:
pathOf
in interfaceArtifactRepository
-
pathOfRemoteRepositoryMetadata
- Specified by:
pathOfRemoteRepositoryMetadata
in interfaceArtifactRepository
-
pathOfLocalRepositoryMetadata
public String pathOfLocalRepositoryMetadata(ArtifactMetadata metadata, ArtifactRepository repository) - Specified by:
pathOfLocalRepositoryMetadata
in interfaceArtifactRepository
-
setLayout
- Specified by:
setLayout
in interfaceArtifactRepository
-
getLayout
- Specified by:
getLayout
in interfaceArtifactRepository
-
setSnapshotUpdatePolicy
- Specified by:
setSnapshotUpdatePolicy
in interfaceArtifactRepository
-
getSnapshots
- Specified by:
getSnapshots
in interfaceArtifactRepository
-
setReleaseUpdatePolicy
- Specified by:
setReleaseUpdatePolicy
in interfaceArtifactRepository
-
getReleases
- Specified by:
getReleases
in interfaceArtifactRepository
-
getKey
- Specified by:
getKey
in interfaceArtifactRepository
-
toString
-
find
- Specified by:
find
in interfaceArtifactRepository
- Parameters:
artifact
-
-
findVersions
Description copied from interface:ArtifactRepository
Finds the versions of the specified artifact that are available in this repository.- Specified by:
findVersions
in interfaceArtifactRepository
- Parameters:
artifact
- The artifact whose available versions should be determined, must not benull
.- Returns:
- The available versions of the artifact or an empty list if none, never
null
.
-
getId
- Specified by:
getId
in interfaceArtifactRepository
-
getUrl
- Specified by:
getUrl
in interfaceArtifactRepository
-
getBasedir
- Specified by:
getBasedir
in interfaceArtifactRepository
-
getProtocol
- Specified by:
getProtocol
in interfaceArtifactRepository
-
setId
- Specified by:
setId
in interfaceArtifactRepository
-
setUrl
- Specified by:
setUrl
in interfaceArtifactRepository
-
hashCode
public int hashCode() -
equals
-
eq
protected static <T> boolean eq(T s1, T s2) -
getAuthentication
- Specified by:
getAuthentication
in interfaceArtifactRepository
-
setAuthentication
- Specified by:
setAuthentication
in interfaceArtifactRepository
-
getProxy
- Specified by:
getProxy
in interfaceArtifactRepository
-
setProxy
- Specified by:
setProxy
in interfaceArtifactRepository
-
isBlacklisted
public boolean isBlacklisted()- Specified by:
isBlacklisted
in interfaceArtifactRepository
-
setBlacklisted
public void setBlacklisted(boolean blackListed) - Specified by:
setBlacklisted
in interfaceArtifactRepository
-
isUniqueVersion
public boolean isUniqueVersion()- Specified by:
isUniqueVersion
in interfaceArtifactRepository
-
isProjectAware
public boolean isProjectAware()Description copied from interface:ArtifactRepository
Indicates whether this repository is backed by actual projects. For instance, the build reactor or IDE workspace are examples of such repositories.- Specified by:
isProjectAware
in interfaceArtifactRepository
- Returns:
true
if the repository is backed by actual projects,false
otherwise.
-
getMirroredRepositories
- Specified by:
getMirroredRepositories
in interfaceArtifactRepository
- Returns:
- the repositories mirrored by the actual one
-
setMirroredRepositories
- Specified by:
setMirroredRepositories
in interfaceArtifactRepository
- Parameters:
mirroredRepositories
- the repositories that the actual one mirrors
-
isBlocked
public boolean isBlocked()- Specified by:
isBlocked
in interfaceArtifactRepository
-
setBlocked
public void setBlocked(boolean blocked) - Specified by:
setBlocked
in interfaceArtifactRepository
-