|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecteu.lindenbaum.maven.util.MavenUtils
public final class MavenUtils
Containing utilities related to maven plugins/projects.
| Nested Class Summary | |
|---|---|
static class |
MavenUtils.LogLevel
Corresponds to the log levels of Log. |
| Field Summary | |
|---|---|
static String |
FAT_SEPARATOR
|
static String |
SEPARATOR
|
| Constructor Summary | |
|---|---|
MavenUtils()
|
|
| Method Summary | |
|---|---|
static org.apache.maven.artifact.versioning.VersionRange |
createVersionRange(String versionSpec)
Returns a VersionRange from a given string specification. |
static org.apache.maven.artifact.Artifact |
getArtifact(org.apache.maven.artifact.Artifact from,
String version,
MavenComponents components)
Returns an Artifact object of a specific Artifact with a
specific version. |
static File |
getArtifactFile(org.apache.maven.artifact.Artifact artifact,
MavenComponents components)
Returns an (existing) file pointing to an Artifact of an
ArtifactRepository. |
static Set<String> |
getArtifactIds(Collection<org.apache.maven.artifact.Artifact> artifacts)
Converts a Collection of Artifacts into a Set
containing their artifactIds. |
static Set<org.apache.maven.artifact.Artifact> |
getArtifacts(org.apache.maven.project.MavenProject project)
Returns the transitive dependency artifacts of a project using MavenProject.getArtifacts(). |
static Set<org.apache.maven.artifact.versioning.ArtifactVersion> |
getAvailableVersions(org.apache.maven.artifact.Artifact artifact,
MavenComponents components)
Returns a Set of available versions for an artifact in the given
repositories. |
static Set<org.apache.maven.artifact.Artifact> |
getDependencies(org.apache.maven.project.MavenProject project)
Returns the direct dependency artifacts of a project using MavenProject.getDependencyArtifacts(). |
static Set<org.apache.maven.artifact.Artifact> |
getErlangArtifacts(org.apache.maven.project.MavenProject project)
Returns the transitive erlang artifacts of a project using MavenProject.getArtifacts() filtered for
PackagingType.ERLANG_OTP and PackagingType.ERLANG_STD
packaged projects. |
static Set<org.apache.maven.artifact.Artifact> |
getErlangDependencies(org.apache.maven.project.MavenProject project)
Returns the direct erlang dependencies of a project using MavenProject.getDependencyArtifacts() filtered for
PackagingType.ERLANG_OTP and PackagingType.ERLANG_STD
packaged projects. |
static Set<org.apache.maven.artifact.Artifact> |
getErlangDependenciesToPackage(org.apache.maven.project.MavenProject project)
Returns the direct erlang dependencies of a project using MavenProject.getDependencyArtifacts() filtered for
PackagingType.ERLANG_OTP and PackagingType.ERLANG_STD
packaged projects. |
static Set<org.apache.maven.artifact.Artifact> |
getErlangReleaseArtifacts(org.apache.maven.project.MavenProject project)
Returns the transitive erlang artifacts of a project using MavenProject.getArtifacts() filtered for
PackagingType.ERLANG_OTP and PackagingType.ERLANG_STD
packaged projects. |
static Set<org.apache.maven.artifact.Artifact> |
getForeignDependencies(org.apache.maven.project.MavenProject project)
Returns the direct non-erlang dependencies of a project using MavenProject.getDependencyArtifacts(). |
static Set<org.apache.maven.artifact.Artifact> |
getForeignDependenciesToPackage(org.apache.maven.project.MavenProject project)
Returns the direct non-erlang dependencies of a project using MavenProject.getDependencyArtifacts(). |
static String |
getReleaseName(org.apache.maven.artifact.Artifact artifact)
Returns the release name for the given Artifact. |
static void |
logContent(org.apache.maven.plugin.logging.Log log,
MavenUtils.LogLevel level,
File file)
Logs the absolute path of a file along with its content using a specific logger. |
static void |
logMultiLineString(org.apache.maven.plugin.logging.Log log,
MavenUtils.LogLevel level,
String multiLineString)
Logs a multi line string containing either unix or windows style line breaks using a specific logger. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static String SEPARATOR
public static String FAT_SEPARATOR
| Constructor Detail |
|---|
public MavenUtils()
| Method Detail |
|---|
public static Set<org.apache.maven.artifact.versioning.ArtifactVersion> getAvailableVersions(org.apache.maven.artifact.Artifact artifact,
MavenComponents components)
throws org.apache.maven.plugin.MojoExecutionException
Set of available versions for an artifact in the given
repositories.
artifact - to lookup in the repositorycomponents - a bean holding maven specific components
null Set of ArtifactVersions
org.apache.maven.plugin.MojoExecutionException
public static File getArtifactFile(org.apache.maven.artifact.Artifact artifact,
MavenComponents components)
throws org.apache.maven.plugin.MojoExecutionException
Artifact of an
ArtifactRepository. The artifact will first be resolved.
artifact - to lookup in the repositorycomponents - a bean holding maven specific components
org.apache.maven.plugin.MojoExecutionException
public static org.apache.maven.artifact.Artifact getArtifact(org.apache.maven.artifact.Artifact from,
String version,
MavenComponents components)
Artifact object of a specific Artifact with a
specific version.
from - to cloneversion - of the returned artifactcomponents - a bean holding maven specific components
Artifact with the requested version
public static org.apache.maven.artifact.versioning.VersionRange createVersionRange(String versionSpec)
throws org.apache.maven.plugin.MojoExecutionException
VersionRange from a given string specification.
versionSpec - to create a VersionRange from
org.apache.maven.plugin.MojoExecutionException - if specification is invalidpublic static Set<String> getArtifactIds(Collection<org.apache.maven.artifact.Artifact> artifacts)
Collection of Artifacts into a Set
containing their artifactIds.
artifacts - to get the artifactIds from
null Set object containing artifactIds.public static String getReleaseName(org.apache.maven.artifact.Artifact artifact)
Artifact. The release name
consists of the artifacts id and its version.
artifact - to retrieve the release name from
public static Set<org.apache.maven.artifact.Artifact> getErlangReleaseArtifacts(org.apache.maven.project.MavenProject project)
MavenProject.getArtifacts() filtered for
PackagingType.ERLANG_OTP and PackagingType.ERLANG_STD
packaged projects. This will return all Artifact with scopes other
than test and provided.
project - to get the dependencies for
null Set of dependency artifactspublic static Set<org.apache.maven.artifact.Artifact> getErlangDependenciesToPackage(org.apache.maven.project.MavenProject project)
MavenProject.getDependencyArtifacts() filtered for
PackagingType.ERLANG_OTP and PackagingType.ERLANG_STD
packaged projects. This will return all Artifact with scopes other
than test and provided.
project - to get the dependencies for
null Set of dependency artifactspublic static Set<org.apache.maven.artifact.Artifact> getErlangArtifacts(org.apache.maven.project.MavenProject project)
MavenProject.getArtifacts() filtered for
PackagingType.ERLANG_OTP and PackagingType.ERLANG_STD
packaged projects.
project - to get the dependencies for
null Set of dependency artifactspublic static Set<org.apache.maven.artifact.Artifact> getErlangDependencies(org.apache.maven.project.MavenProject project)
MavenProject.getDependencyArtifacts() filtered for
PackagingType.ERLANG_OTP and PackagingType.ERLANG_STD
packaged projects.
project - to get the dependencies for
null Set of dependency artifactspublic static Set<org.apache.maven.artifact.Artifact> getForeignDependenciesToPackage(org.apache.maven.project.MavenProject project)
MavenProject.getDependencyArtifacts(). All erlang artifacts will be
filtered out. This will return all Artifact with scopes other than
test and provided.
project - to get the dependencies for
null Set of dependency artifactspublic static Set<org.apache.maven.artifact.Artifact> getForeignDependencies(org.apache.maven.project.MavenProject project)
MavenProject.getDependencyArtifacts(). All erlang artifacts will be
filtered out.
project - to get the dependencies for
null Set of dependency artifactspublic static Set<org.apache.maven.artifact.Artifact> getDependencies(org.apache.maven.project.MavenProject project)
MavenProject.getDependencyArtifacts().
project - to get the dependencies for
null Set of dependency artifactspublic static Set<org.apache.maven.artifact.Artifact> getArtifacts(org.apache.maven.project.MavenProject project)
MavenProject.getArtifacts().
project - to get the dependencies for
null Set of dependency artifacts
public static void logContent(org.apache.maven.plugin.logging.Log log,
MavenUtils.LogLevel level,
File file)
log - logger to uselevel - priority to log the filefile - to read the content from
public static void logMultiLineString(org.apache.maven.plugin.logging.Log log,
MavenUtils.LogLevel level,
String multiLineString)
log - logger to use.level - priority to log the messagemultiLineString - to log
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||