Class DefaultRepositoryRequest
- java.lang.Object
-
- org.apache.maven.artifact.repository.DefaultRepositoryRequest
-
- All Implemented Interfaces:
RepositoryRequest
public class DefaultRepositoryRequest extends java.lang.Object implements RepositoryRequest
Collects basic settings to access the repository system.- Author:
- Benjamin Bentmann
-
-
Constructor Summary
Constructors Constructor Description DefaultRepositoryRequest()Creates an empty repository request.DefaultRepositoryRequest(RepositoryRequest repositoryRequest)Creates a shallow copy of the specified repository request.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.maven.artifact.repository.ArtifactRepositorygetLocalRepository()Gets the local repository to use.java.util.List<org.apache.maven.artifact.repository.ArtifactRepository>getRemoteRepositories()Gets the remote repositories to use.static RepositoryRequestgetRepositoryRequest(MavenSession session, MavenProject project)booleanisForceUpdate()Indicates whether remote repositories should be re-checked for updated artifacts/metadata regardless of their configured update policy.booleanisOffline()Indicates whether network access to remote repositories has been disabled.DefaultRepositoryRequestsetForceUpdate(boolean forceUpdate)Enables/disabled forced checks for updated artifacts/metadata on remote repositories.DefaultRepositoryRequestsetLocalRepository(org.apache.maven.artifact.repository.ArtifactRepository localRepository)Sets the local repository to use.DefaultRepositoryRequestsetOffline(boolean offline)Enables/disables network access to remote repositories.DefaultRepositoryRequestsetRemoteRepositories(java.util.List<org.apache.maven.artifact.repository.ArtifactRepository> remoteRepositories)Sets the remote repositories to use.
-
-
-
Constructor Detail
-
DefaultRepositoryRequest
public DefaultRepositoryRequest()
Creates an empty repository request.
-
DefaultRepositoryRequest
public DefaultRepositoryRequest(RepositoryRequest repositoryRequest)
Creates a shallow copy of the specified repository request.- Parameters:
repositoryRequest- The repository request to copy from, must not benull.
-
-
Method Detail
-
getRepositoryRequest
public static RepositoryRequest getRepositoryRequest(MavenSession session, MavenProject project)
-
isOffline
public boolean isOffline()
Description copied from interface:RepositoryRequestIndicates whether network access to remote repositories has been disabled.- Specified by:
isOfflinein interfaceRepositoryRequest- Returns:
trueif remote access has been disabled,falseotherwise.
-
setOffline
public DefaultRepositoryRequest setOffline(boolean offline)
Description copied from interface:RepositoryRequestEnables/disables network access to remote repositories.- Specified by:
setOfflinein interfaceRepositoryRequest- Parameters:
offline-trueto disable remote access,falseto allow network access.- Returns:
- This request, never
null.
-
isForceUpdate
public boolean isForceUpdate()
Description copied from interface:RepositoryRequestIndicates whether remote repositories should be re-checked for updated artifacts/metadata regardless of their configured update policy.- Specified by:
isForceUpdatein interfaceRepositoryRequest- Returns:
trueif remote repositories should be re-checked for updated artifacts/metadata,falseotherwise.
-
setForceUpdate
public DefaultRepositoryRequest setForceUpdate(boolean forceUpdate)
Description copied from interface:RepositoryRequestEnables/disabled forced checks for updated artifacts/metadata on remote repositories.- Specified by:
setForceUpdatein interfaceRepositoryRequest- Parameters:
forceUpdate-trueto forcibly check the remote repositories for updated artifacts/metadata,falseto use the update policy configured on each repository.- Returns:
- This request, never
null.
-
getLocalRepository
public org.apache.maven.artifact.repository.ArtifactRepository getLocalRepository()
Description copied from interface:RepositoryRequestGets the local repository to use.- Specified by:
getLocalRepositoryin interfaceRepositoryRequest- Returns:
- The local repository to use or
nullif not set.
-
setLocalRepository
public DefaultRepositoryRequest setLocalRepository(org.apache.maven.artifact.repository.ArtifactRepository localRepository)
Description copied from interface:RepositoryRequestSets the local repository to use.- Specified by:
setLocalRepositoryin interfaceRepositoryRequest- Parameters:
localRepository- The local repository to use.- Returns:
- This request, never
null.
-
getRemoteRepositories
public java.util.List<org.apache.maven.artifact.repository.ArtifactRepository> getRemoteRepositories()
Description copied from interface:RepositoryRequestGets the remote repositories to use.- Specified by:
getRemoteRepositoriesin interfaceRepositoryRequest- Returns:
- The remote repositories to use, never
null.
-
setRemoteRepositories
public DefaultRepositoryRequest setRemoteRepositories(java.util.List<org.apache.maven.artifact.repository.ArtifactRepository> remoteRepositories)
Description copied from interface:RepositoryRequestSets the remote repositories to use.- Specified by:
setRemoteRepositoriesin interfaceRepositoryRequest- Parameters:
remoteRepositories- The remote repositories to use.- Returns:
- This request, never
null.
-
-