Package org.apache.maven.api
Interface PathType
- All Known Implementing Classes:
JavaPathType
,JavaPathType.Modular
The option of a command-line tool where to place the paths to some dependencies.
A
PathType
can identify the Java class-path, the Java module-path,
or another kind of path for another programming language for example.
Path types are often exclusive. For example, a dependency should not be
both on the Java class-path and on the Java module-path.- Since:
- 4.0.0
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final PathType
The type for all paths that could not be placed in any of the types requested by a caller. -
Method Summary
Modifier and TypeMethodDescriptionid()
Returns the unique name of this path type, including the module to patch if any.name()
Returns the name of this path type.option()
Returns the name of the tool option for this path.String[]
Returns the option followed by a string representation of the given path elements.toString()
Returns a string representation for this extensible enum describing a path type.
-
Field Details
-
UNRESOLVED
The type for all paths that could not be placed in any of the types requested by a caller. This type can appear in the return value of a call toresolveDependencies(...)
when at least one dependency cannot be associated to any type specified in thedesiredTypes
argument. Plugins can choose to report a warning to users when unresolved paths exist.
-
-
Method Details
-
id
Returns the unique name of this path type, including the module to patch if any. For example, if this type isJavaPathType.MODULES
, then this method returns"MODULES"
. But if this type was created byJavaPathType.patchModule("foo.bar")
, then this method returns"PATCH_MODULE:foo.bar"
.- Returns:
- the programmatic name together with the module name on which it applies
- See Also:
-
option
Returns the name of the tool option for this path. For example, if this path type isJavaPathType.MODULES
, then this method returns"--module-path"
. The option does not include the module name on which it applies.- Returns:
- the name of the tool option for this path type
-
option
Returns the option followed by a string representation of the given path elements. The path elements are separated by an option-specific or platform-specific separator. If the givenpaths
argument contains no element, then this method returns an empty string.Examples
Ifpaths
is a list containing two elements,dir/path1
anddir/path2
, then:- If this type is
JavaPathType.MODULES
, then this method returns{"--module-path", "dir/path1:dir/path2"}
on Unix or{"--module-path", "dir\path1;dir\path2"}
on Windows. - If this type was created by
JavaPathType.patchModule("foo.bar")
, then the method returns{"--patch-module", "foo.bar=dir/path1:dir/path2"}
on Unix or{"--patch-module", "foo.bar=dir\path1;dir\path2"}
on Windows.
- Parameters:
paths
- the path to format as a string- Returns:
- the option associated to this path type followed by the given path elements, or an empty array if there is no path element.
- If this type is
-
name
Returns the name of this path type. For example, if this path type isJavaPathType.MODULES
, then this method returns"MODULES"
.- Returns:
- the programmatic name of this path type
-
toString
Returns a string representation for this extensible enum describing a path type.. For example"PathType[PATCH_MODULE:foo.bar]"
.
-