eu.lindenbaum.maven.util
Class MavenUtils

java.lang.Object
  extended by eu.lindenbaum.maven.util.MavenUtils

public final class MavenUtils
extends Object

Containing utilities related to maven plugins/projects.

Author:
Tobias Schlager , Olle Törnström

Field Summary
static String SEPARATOR
           
 
Constructor Summary
MavenUtils()
           
 
Method Summary
static org.apache.maven.artifact.Artifact getArtifact(org.apache.maven.artifact.Artifact from, String version)
          Returns an Artifact object of a specific Artifact with a specific version.
static File getArtifactFile(org.apache.maven.artifact.Artifact artifact, org.apache.maven.artifact.repository.ArtifactRepository repository)
          Returns an (existing) file pointing to an Artifact of an ArtifactRepository.
static File getPluginFile(String artifactId, org.apache.maven.project.MavenProject project, org.apache.maven.artifact.repository.ArtifactRepository repository)
          Returns an (existing) file pointing to a plugin Artifact used by a MavenProject from a ArtifactRepository.
static String getReleaseName(org.apache.maven.artifact.Artifact artifact)
          Returns the release name for the given Artifact.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SEPARATOR

public static String SEPARATOR
Constructor Detail

MavenUtils

public MavenUtils()
Method Detail

getPluginFile

public static File getPluginFile(String artifactId,
                                 org.apache.maven.project.MavenProject project,
                                 org.apache.maven.artifact.repository.ArtifactRepository repository)
                          throws org.apache.maven.plugin.MojoExecutionException
Returns an (existing) file pointing to a plugin Artifact used by a MavenProject from a ArtifactRepository.

Parameters:
artifactId - to lookup in the project
project - to scan for the plugin Artifact
repository - to scan for the artifact
Returns:
an existing file pointing to a plugin artifact
Throws:
org.apache.maven.plugin.MojoExecutionException

getArtifactFile

public static File getArtifactFile(org.apache.maven.artifact.Artifact artifact,
                                   org.apache.maven.artifact.repository.ArtifactRepository repository)
                            throws org.apache.maven.plugin.MojoExecutionException
Returns an (existing) file pointing to an Artifact of an ArtifactRepository.

Parameters:
artifact - to lookup in the repository
repository - to scan for the artifact
Returns:
an existing file pointing to an artifact
Throws:
org.apache.maven.plugin.MojoExecutionException

getArtifact

public static org.apache.maven.artifact.Artifact getArtifact(org.apache.maven.artifact.Artifact from,
                                                             String version)
Returns an Artifact object of a specific Artifact with a specific version.

Parameters:
from - to clone
version - of the returned artifact
Returns:
a new Artifact with the requested version

getReleaseName

public static String getReleaseName(org.apache.maven.artifact.Artifact artifact)
Returns the release name for the given Artifact. The release name consists of the artifacts id and its version.

Parameters:
artifact - to retrieve the release name from
Returns:
a string containing the release name


Copyright © 2010 Lindenbaum GmbH. All Rights Reserved.