net.sourceforge.fluxion.spi.utils
Class MavenUtils
java.lang.Object
net.sourceforge.fluxion.spi.utils.MavenUtils
public class MavenUtils
- extends java.lang.Object
A general utilities class for doing common operations required for
interaction with the Maven build system.
- Author:
- Tony Burdett
Method Summary |
static void |
commitArtifactToLocalRepo(java.lang.String groupId,
java.lang.String artifactId,
java.lang.String version,
java.io.File jarFile)
|
static java.util.Map<java.lang.String,java.lang.String> |
fetchArtifactIdentity(java.io.File jarFile)
Inspects the jar file passed in order to extract the key Maven artifact
properties. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MavenUtils
public MavenUtils()
fetchArtifactIdentity
public static java.util.Map<java.lang.String,java.lang.String> fetchArtifactIdentity(java.io.File jarFile)
throws java.io.IOException,
BadMavenArtifactException
- Inspects the jar file passed in order to extract the key Maven artifact
properties. This will return a map containing the main property names as
keys - namely, "groupId", "artifactId" and "version", and the appropriate
values for this artifact. In the case where the passed file is not a
readable jar file, an
IOException
will be thrown, and if it cannot
be determined if this is a properly packaged Maven artifact an BadMavenArtifactException
will be thrown.
- Parameters:
jarFile
- the Maven artifact, packaged as a jar file
- Returns:
- a Map containing keys for groupId, artifactId and version
- Throws:
java.io.IOException
- if the file cannot be accessed or is not
a jar file
BadMavenArtifactException
- if the jar file is not a correctly
packaged Maven artifact or cannot be
inspected
commitArtifactToLocalRepo
public static void commitArtifactToLocalRepo(java.lang.String groupId,
java.lang.String artifactId,
java.lang.String version,
java.io.File jarFile)
Copyright © 2010. All Rights Reserved.