Top Fields Constructors Methods
org.jboss.modules.maven

pack-priv final Class DefaultMavenResolver

extends Object
implements MavenResolver
Class Inheritance
All Implemented Interfaces
org.jboss.modules.maven.MavenResolver
Static Imports
org.jboss.modules.maven.MavenArtifactUtil.doIo

Field Summary

Modifier and TypeField and Description
private final AccessControlContext
context

Deprecated as a consequence of AccessControlContext being deprecated.

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public File
resolveArtifact(final ArtifactCoordinates
the non-null Maven coordinates object
coordinates
,
final String
a non-null string with the exact packaging type desired (e.g. pom, jar, etc.)
packaging
)

Implements org.jboss.modules.maven.MavenResolver.resolveArtifact.

Tries to find a maven jar artifact from the system property "maven.repo.local" This property is a list of platform separated directory names.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

contextback to summary
private final AccessControlContext context

Deprecated

as a consequence of AccessControlContext being deprecated. See corresponding docs for further information.

Constructor Detail

DefaultMavenResolverback to summary
pack-priv DefaultMavenResolver()

Method Detail

resolveArtifactback to summary
public File resolveArtifact(final ArtifactCoordinates coordinates, final String packaging) throws IOException

Implements org.jboss.modules.maven.MavenResolver.resolveArtifact.

Doc from org.jboss.modules.maven.MavenResolver.resolveArtifact.

Tries to find a maven jar artifact from the system property "maven.repo.local" This property is a list of platform separated directory names. If not specified, then it looks in ${user.home}/.m2/repository by default.

If it can't find it in local paths, then will try to download from a remote repository from the system property "remote.maven.repo". There is no default remote repository. It will download both the pom and jar and put it into the first directory listed in "maven.repo.local" (or the default directory). This directory will be created if it doesn't exist.

Finally, if you do not want a message to console, then set the system property "maven.download.message" to "false".

Parameters
coordinates:ArtifactCoordinates

the non-null Maven coordinates object

packaging:String

a non-null string with the exact packaging type desired (e.g. pom, jar, etc.)

Returns:File

the absolute path to the artifact, or null if none exists

Exceptions
IOException:
if acquiring the artifact path failed for some reason