Class DefaultModelPathTranslator
java.lang.Object
org.apache.maven.internal.impl.model.DefaultModelPathTranslator
- All Implemented Interfaces:
ModelPathTranslator
@Named
@Singleton
public class DefaultModelPathTranslator
extends Object
implements ModelPathTranslator
Resolves relative paths within a model against a specific base directory.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate StringalignToBaseDirectory(String path, Path basedir) Returns a path relocated to the given base directory.alignToBaseDirectory(Model model, Path basedir, ModelBuilderRequest request) Resolves the well-known paths of the specified model against the given base directory.private ResourcealignToBaseDirectory(Resource resource, Path basedir) Returns a resource with all properties identical to the given resource, except the paths which are resolved according the givenbasedir.private <T> List<T>
-
Field Details
-
pathTranslator
-
-
Constructor Details
-
DefaultModelPathTranslator
-
-
Method Details
-
alignToBaseDirectory
Description copied from interface:ModelPathTranslatorResolves the well-known paths of the specified model against the given base directory. Paths within plugin configuration are not processed.- Specified by:
alignToBaseDirectoryin interfaceModelPathTranslator- Parameters:
model- The model whose paths should be resolved, may benull.basedir- The base directory to resolve relative paths against, may benull.request- The model building request that holds further settings, must not benull.
-
map
-
alignToBaseDirectory
Returns a resource with all properties identical to the given resource, except the paths which are resolved according the givenbasedir. If the paths are unchanged, then this method returns the previous instance.- Parameters:
resource- the resource to relocate, ornullbasedir- the new base directory- Returns:
- relocated resource, or
nullif the given resource was null
-
alignToBaseDirectory
Returns a path relocated to the given base directory. If the result of this operation is the same path as before, then this method returns the oldpathinstance. It is okay for the caller to compare theStringinstances using the identity comparator for detecting changes.- Parameters:
path- the path to relocate, ornullbasedir- the new base directory- Returns:
- relocated path, or
nullif the given path was null
-