Package org.jppf.location
Class MavenLocation
java.lang.Object
org.jppf.location.AbstractLocation<URL>
org.jppf.location.URLLocation
org.jppf.location.MavenLocation
- All Implemented Interfaces:
Serializable,Location<URL>
- Direct Known Subclasses:
MavenCentralLocation
This location provides a way to download artifacts from a Maven repository, using a maven-like artifact location specification.
Note: instances of this class allow access to a single artifact and do not in any way handle Maven transitive dependencies.
- Since:
- 6.1
- Author:
- Laurent Cohen
- See Also:
-
Field Summary
Fields inherited from class org.jppf.location.AbstractLocation
eventsEnabled, listeners, path -
Constructor Summary
ConstructorsConstructorDescriptionMavenLocation(String repositoryURL, String gav) Create this maven central location with the specified GAV string and default "jar" packaging.MavenLocation(String repositoryURL, String gav, String packaging) Create this maven central location with the specified GAV string and packaging.MavenLocation(String repositoryURL, String groupId, String artifactId, String version) Create this maven central location with the specified group id, artifact id, version and default "jar" packaging.MavenLocation(String repositoryURL, String groupId, String artifactId, String version, String packaging) Create this maven central location with the specified group id, artifact id, version and packaging. -
Method Summary
Modifier and TypeMethodDescriptionGet the artifact id of the correpsonding Maven artifact.Get the group id of the correpsonding Maven artifact.Since it is not possible to upload data directly to Maven central, this method will always throw anUnsupportedOperationException.Get the packaging of the correpsonding Maven artifact.The URL of the Maven repository this location points to.Get the version of the correpsonding Maven artifact.toString()Methods inherited from class org.jppf.location.URLLocation
getInputStream, sizeMethods inherited from class org.jppf.location.AbstractLocation
addLocationEventListener, copyTo, fireLocationEvent, getPath, removeLocationEventListener, toByteArray
-
Constructor Details
-
MavenLocation
public MavenLocation(String repositoryURL, String gav, String packaging) throws MalformedURLException Create this maven central location with the specified GAV string and packaging.Example:
Location<URL> location = new MavenLocation("file:///home/me/.m2/repository", "org.jppf:jppf-admin:5.2.9", "jar");- Parameters:
repositoryURL- the URL of the Maven repository this location points to.gav- the maven identifier in format "groupId:artifactId:version".packaging- the type of packaging of the artifact: jar, war, etc.- Throws:
MalformedURLException- if resulting URL is incorrect.
-
MavenLocation
Create this maven central location with the specified GAV string and default "jar" packaging.Example:
Location<URL> location = new MavenLocation("file:///home/me/.m2/repository", "org.jppf:jppf-admin:5.2.9");- Parameters:
repositoryURL- the URL of the Maven repository this location points to.gav- the maven identifier in format "groupId:artifactId:version".- Throws:
MalformedURLException- if resulting URL is incorrect.
-
MavenLocation
public MavenLocation(String repositoryURL, String groupId, String artifactId, String version) throws MalformedURLException Create this maven central location with the specified group id, artifact id, version and default "jar" packaging.Example:
Location<URL> location = new MavenLocation("file:///home/me/.m2/repository", "org.jppf", "jppf-admin", "5.2.9");- Parameters:
repositoryURL- the URL of the Maven repository this location points to.groupId- the maven group id.artifactId- the maven artifact id.version- the maven version of the artifact.- Throws:
MalformedURLException- if resulting URL is incorrect.
-
MavenLocation
public MavenLocation(String repositoryURL, String groupId, String artifactId, String version, String packaging) throws MalformedURLException Create this maven central location with the specified group id, artifact id, version and packaging.Example:
Location<URL> location = new MavenLocation("file:///home/me/.m2/repository", "org.jppf", "jppf-admin", "5.2.9", "jar");- Parameters:
repositoryURL- the URL of the Maven repository this location points to.groupId- the maven group id.artifactId- the maven artifact id.version- the maven version of the artifact.packaging- the type of packaging of the artifact: jar, war, etc.- Throws:
MalformedURLException- if resulting URL is incoreect.
-
-
Method Details
-
getOutputStream
Since it is not possible to upload data directly to Maven central, this method will always throw anUnsupportedOperationException.- Specified by:
getOutputStreamin interfaceLocation<URL>- Overrides:
getOutputStreamin classURLLocation- Returns:
- an
OutputStreaminstance. - Throws:
Exception- if an I/O error occurs.
-
getRepositoryURL
The URL of the Maven repository this location points to.- Returns:
- the repository URL as a string.
-
getGroupId
Get the group id of the correpsonding Maven artifact.- Returns:
- the groupId string.
-
getArtifactId
Get the artifact id of the correpsonding Maven artifact.- Returns:
- the artifactId string.
-
getVersion
Get the version of the correpsonding Maven artifact.- Returns:
- the version string.
-
getPackaging
Get the packaging of the correpsonding Maven artifact.- Returns:
- the packaging string.
-
toString
- Overrides:
toStringin classAbstractLocation<URL>
-