Package org.apache.maven.api
Interface Type
- All Superinterfaces:
ExtensibleEnum
- All Known Implementing Classes:
DefaultType
,DefaultType
A dependency's
Type
is uniquely identified by a String
,
and semantically represents a known kind of dependency.
It provides information about the file type (or extension) of the associated artifact, its default classifier, and how the artifact will be used in the build when creating class-paths or module-paths.
For example, the type java-source
has a jar
extension and a
sources
classifier. The artifact and its dependencies should be added
to the build path.
- Since:
- 4.0.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Artifact type name for a BOM file.static final String
Artifact type name for a JAR file to unconditionally place on the class-path.static final String
Artifact type name for a JAR file to unconditionally place on the annotation processor class-path.static final String
Artifact type name for a fat-JAR file that can be only on the class-path.static final String
Artifact type name for a JAR file that can be placed either on the class-path or on the module-path.static final String
Artifact type name for source code packaged in a JAR file.static final String
Artifact type name for javadoc packaged in a JAR file.static final String
Artifact type name for a Maven plugin.static final String
Artifact type name for a JAR file to unconditionally place on the module-path.static final String
Artifact type name for a JAR file to unconditionally place on the annotation processor module-path.static final String
Artifact type name for a POM file.static final String
Artifact type name for a JAR file that can be placed either on the annotation processor class-path or module-path.static final String
Artifact type name for a JAR file containing test classes. -
Method Summary
Modifier and TypeMethodDescriptionGet the default classifier associated to the dependency type.Get the file extension of artifacts of this type.Returns the dependency type language.Types of path (class-path, module-path, …) where the dependency can be placed.id()
Returns the dependency type id.boolean
Specifies if the artifact already embeds its own dependencies.
-
Field Details
-
POM
Artifact type name for a POM file.- See Also:
-
BOM
Artifact type name for a BOM file.- See Also:
-
JAR
Artifact type name for a JAR file that can be placed either on the class-path or on the module-path. The path (classes or modules) is chosen by the plugin, possibly using heuristic rules. This is the behavior of Maven 3.- See Also:
-
FATJAR
Artifact type name for a fat-JAR file that can be only on the class-path. The fat-JAR is a self-contained JAR and its transitive dependencies will not be resolved, if any. This type is new in Maven 4.- See Also:
-
CLASSPATH_JAR
Artifact type name for a JAR file to unconditionally place on the class-path. If the JAR is modular, its module information are ignored. This type is new in Maven 4.- See Also:
-
MODULAR_JAR
Artifact type name for a JAR file to unconditionally place on the module-path. If the JAR is not modular, then it is loaded by Java as an unnamed module. This type is new in Maven 4.- See Also:
-
PROCESSOR
Artifact type name for a JAR file that can be placed either on the annotation processor class-path or module-path. The path (classes or modules) is chosen by the plugin, possibly using heuristic rules.- See Also:
-
CLASSPATH_PROCESSOR
Artifact type name for a JAR file to unconditionally place on the annotation processor class-path. If the JAR is modular, its module information are ignored.- See Also:
-
MODULAR_PROCESSOR
Artifact type name for a JAR file to unconditionally place on the annotation processor module-path. If the JAR is not modular, then it is loaded by Java as an unnamed module.- See Also:
-
JAVA_SOURCE
Artifact type name for source code packaged in a JAR file.- See Also:
-
JAVADOC
Artifact type name for javadoc packaged in a JAR file.- See Also:
-
MAVEN_PLUGIN
Artifact type name for a Maven plugin.- See Also:
-
TEST_JAR
Artifact type name for a JAR file containing test classes. If the main artifact is placed on the class-path ("jar" or "classpath-jar" types), then the test artifact will also be placed on the class-path. Otherwise, if the main artifact is placed on the module-path ("jar" or "modular-jar" types), then the test artifact will be added using--patch-module
option.- See Also:
-
-
Method Details
-
id
Returns the dependency type id. The id uniquely identifies this dependency type.- Specified by:
id
in interfaceExtensibleEnum
- Returns:
- the id of this type, never
null
.
-
getLanguage
Returns the dependency type language.- Returns:
- the language of this type, never
null
.
-
getExtension
Get the file extension of artifacts of this type.- Returns:
- the file extension, never
null
.
-
getClassifier
Get the default classifier associated to the dependency type. The default classifier can be overridden when specifying theDependency.getClassifier()
.- Returns:
- the default classifier, or
null
.
-
isIncludesDependencies
boolean isIncludesDependencies()Specifies if the artifact already embeds its own dependencies. This is the case for JEE packages or similar artifacts such as WARs, EARs, etc.- Returns:
- if the artifact's dependencies are included in the artifact
-
getPathTypes
Types of path (class-path, module-path, …) where the dependency can be placed. For most deterministic builds, the array length should be 1. In such case, the dependency will be unconditionally placed on the specified type of path and no heuristic rule will be involved.It is nevertheless common to specify two or more types of path. For example, a Java library may be compatible with either the class-path or the module-path, and the user may have provided no instruction about which type to use. In such case, the plugin may apply rules for choosing a path. See for example
JavaPathType.CLASSES
andJavaPathType.MODULES
.
-