Package org.apache.maven.shared.mapping
Class MappingUtils
- java.lang.Object
-
- org.apache.maven.shared.mapping.MappingUtils
-
public final class MappingUtils extends Object
Utilities used to evaluate an expression.
The expression might use any field of the
Artifact
interface. Some examples might be:- @{artifactId}@-@{version}@@{dashClassifier?}@.@{extension}@
- @{artifactId}@-@{version}@.@{extension}@
- @{artifactId}@.@{extension}@
Although parts of this code comes from the Assembly Plugin, it cannot be shared with the Assembly Plugin. The reason for this is that the Assembly Plugin always uses a prefix for the expressions, whereas this code does not.
- Version:
- $Id: MappingUtils.java 1714435 2015-11-15 11:55:21Z khmarbaise $
- Author:
- Stephane Nicoll, Dennis Lundberg
-
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT_FILE_NAME_MAPPING
Default file name mapping.static String
DEFAULT_FILE_NAME_MAPPING_CLASSIFIER
Default file name mapping incl.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
evaluateFileNameMapping(String expression, org.apache.maven.artifact.Artifact artifact)
Evaluates the specified expression for the given artifact.
-
-
-
Field Detail
-
DEFAULT_FILE_NAME_MAPPING
public static final String DEFAULT_FILE_NAME_MAPPING
Default file name mapping.- See Also:
- Constant Field Values
-
DEFAULT_FILE_NAME_MAPPING_CLASSIFIER
public static final String DEFAULT_FILE_NAME_MAPPING_CLASSIFIER
Default file name mapping incl. classifier.- See Also:
- Constant Field Values
-
-
Method Detail
-
evaluateFileNameMapping
public static String evaluateFileNameMapping(String expression, org.apache.maven.artifact.Artifact artifact) throws org.codehaus.plexus.interpolation.InterpolationException
Evaluates the specified expression for the given artifact.- Parameters:
expression
- the expression to evaluateartifact
- the artifact to use as value object for tokens- Returns:
- expression the evaluated expression
- Throws:
org.codehaus.plexus.interpolation.InterpolationException
- In case of an error.
-
-