public class MavenArtifactUtil extends Object
| Constructor and Description |
|---|
MavenArtifactUtil() |
| Modifier and Type | Method and Description |
|---|---|
static File |
copyTempJar(String artifact,
InputStream in) |
static void |
downloadFile(String artifact,
String src,
File dest) |
static org.jboss.modules.MavenSettings |
getSettings() |
static String |
relativeArtifactHttpPath(String groupId,
String artifactId,
String version) |
static String |
relativeArtifactPath(String groupId,
String artifactId,
String version) |
static File |
resolveJarArtifact(String qualifier)
First checks this class's ClassLoader for an embedded maven repository under
m2repo and extracts
the artifact if found. |
public static org.jboss.modules.MavenSettings getSettings()
throws IOException
IOExceptionpublic static File resolveJarArtifact(String qualifier) throws IOException
m2repo and extracts
the artifact if found.
Then tries to find a maven jar artifact from the system property "local.maven.repo.path" 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 "local.maven.repo.path" (or the default dir). 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"qualifier - group:artifact:version[:classifier]IOException - Unable to download artifactpublic static String relativeArtifactPath(String groupId, String artifactId, String version)
public static String relativeArtifactHttpPath(String groupId, String artifactId, String version)
public static File copyTempJar(String artifact, InputStream in) throws IOException
IOExceptionpublic static void downloadFile(String artifact, String src, File dest) throws IOException
IOExceptionCopyright © 2015 JBoss by Red Hat. All rights reserved.