Class MavenRepositoryURL
- java.lang.Object
-
- org.ops4j.pax.url.mvn.internal.config.MavenRepositoryURL
-
public class MavenRepositoryURL extends Object
An URL-like information about Maven repository (local, default or remote) used in Pax URL Aether. Repository URL may be a part of full
mvn:URL, but is also used simply as Maven repository in configuration.There are 3 kinds of repositories:
- local repository - there should be only one, configured using
ServiceConstants.PROPERTY_LOCAL_REPOSITORY, but may also use standard Mavenmaven.repo.localproperty, be read fromsettings.xmlor fall back to~/.m2/repositoryif not specified. - default repositories - these are local, read-only locations (like
$KARAF_HOME/system) which are treated like local repositories during resolution without remote repositories. In short words - if something is available there, it is treated as resolved. If not - skip to next default repository or end the process with normal resolution using remote repositories and local one (for caching of the downloads) - remote repositories - these are usually remote, HTTP repositories, where remote queries are sent to check if the artifact being searched for is available. If so, the artifact is downloaded and cached in local repository.
Local repository and default repositories may be configured as split repositories (since Pax URL 3 and Maven Resolver 1.9).
The repository URL format looks like this:
url := scheme:[//authority]/path[options] authority := [user:password@]host[:port] path := '/' - separated path options := '@'option option := key=value | keyFor example:https://user:password@remote-repository.example.io/maven@id=remote1@snapshots@split=true. Forfile:URLs, there are two confusing variants (let's not talk about Windows-specific ones):file:///path/to/locationfile:/path/to/location
The set of options used depends on whether we use local, default or remote repository. For local/default ones we may use:
ServiceConstants.OPTION_IDServiceConstants.OPTION_MULTIServiceConstants.OPTION_SPLITServiceConstants.OPTION_SPLIT_LOCALServiceConstants.OPTION_SPLIT_REMOTEServiceConstants.OPTION_SPLIT_LOCAL_PREFIXServiceConstants.OPTION_SPLIT_REMOTE_PREFIXServiceConstants.OPTION_SPLIT_RELEASES_PREFIXServiceConstants.OPTION_SPLIT_SNAPSHOTS_PREFIXServiceConstants.OPTION_SPLIT_REMOTE_REPOSITORYServiceConstants.OPTION_SPLIT_REMOTE_REPOSITORY_LAST
ServiceConstants.OPTION_IDServiceConstants.OPTION_DISALLOW_RELEASESServiceConstants.OPTION_ALLOW_SNAPSHOTSServiceConstants.OPTION_UPDATEServiceConstants.OPTION_CHECKSUMServiceConstants.OPTION_RELEASES_UPDATEServiceConstants.OPTION_SNAPSHOTS_UPDATEServiceConstants.OPTION_RELEASES_CHECKSUMServiceConstants.OPTION_SNAPSHOTS_CHECKSUM
- Since:
- 0.2.1, February 07, 2008
- Author:
- Alin Dreghiciu, Guillaume Nodet
- local repository - there should be only one, configured using
-
-
Constructor Summary
Constructors Constructor Description MavenRepositoryURL(String repositorySpec)Creates a maven repository URL bases on a string spec.MavenRepositoryURL(MavenRepositoryURL parent, File child)Create repository URL with other repositor URL as parent andchildwhich should be child directory of parent.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FilegetFile()Getter.StringgetId()Getter.char[]getPassword()StringgetReleasesChecksumPolicy()StringgetReleasesUpdatePolicy()StringgetSnapshotsChecksumPolicy()StringgetSnapshotsUpdatePolicy()StringgetSplitLocalPrefix()StringgetSplitReleasesPrefix()StringgetSplitRemotePrefix()StringgetSplitSnapshotsPrefix()URIgetURI()Getter.StringgetUsername()booleanisFileRepository()Getter.booleanisMulti()Getter.booleanisReleasesEnabled()Getter.booleanisSnapshotsEnabled()Getter.booleanisSplit()booleanisSplitLocal()booleanisSplitRemote()booleanisSplitRemoteRepository()booleanisSplitRemoteRepositoryLast()StringtoString()
-
-
-
Constructor Detail
-
MavenRepositoryURL
public MavenRepositoryURL(String repositorySpec) throws MalformedURLException
Creates a maven repository URL bases on a string spec. The path can be marked with @snapshots and/or @noreleases (not case sensitive).- Parameters:
repositorySpec- url spec of repository- Throws:
MalformedURLException- if spec contains a malformed maven repository urlorg.ops4j.lang.NullArgumentException- if repository spec is null or empty
-
MavenRepositoryURL
public MavenRepositoryURL(MavenRepositoryURL parent, File child)
Create repository URL with other repositor URL as parent andchildwhich should be child directory of parent.- Parameters:
parent-child-
-
-
Method Detail
-
getId
public String getId()
Getter.- Returns:
- repository id
-
getURI
public URI getURI()
Getter.- Returns:
- repository URI
-
getUsername
public String getUsername()
-
getPassword
public char[] getPassword()
-
getFile
public File getFile()
Getter.- Returns:
- repository file
-
isReleasesEnabled
public boolean isReleasesEnabled()
Getter.- Returns:
- true if the repository contains releases
-
isSnapshotsEnabled
public boolean isSnapshotsEnabled()
Getter.- Returns:
- true if the repository contains snapshots
-
getReleasesUpdatePolicy
public String getReleasesUpdatePolicy()
-
getSnapshotsUpdatePolicy
public String getSnapshotsUpdatePolicy()
-
getReleasesChecksumPolicy
public String getReleasesChecksumPolicy()
-
getSnapshotsChecksumPolicy
public String getSnapshotsChecksumPolicy()
-
isMulti
public boolean isMulti()
Getter.- Returns:
- true if the repository is a parent path of repos
-
isFileRepository
public boolean isFileRepository()
Getter.- Returns:
- if the repository is a file based repository.
-
isSplit
public boolean isSplit()
-
getSplitLocalPrefix
public String getSplitLocalPrefix()
-
getSplitRemotePrefix
public String getSplitRemotePrefix()
-
isSplitLocal
public boolean isSplitLocal()
-
isSplitRemote
public boolean isSplitRemote()
-
getSplitReleasesPrefix
public String getSplitReleasesPrefix()
-
getSplitSnapshotsPrefix
public String getSplitSnapshotsPrefix()
-
isSplitRemoteRepository
public boolean isSplitRemoteRepository()
-
isSplitRemoteRepositoryLast
public boolean isSplitRemoteRepositoryLast()
-
-