Package org.apache.maven.api
Interface SourceRoot
- All Known Implementing Classes:
DefaultSourceRoot
public interface SourceRoot
A root directory of source files.
The sources may be Java main classes, test classes, resources or anything else identified by the scope.
-
Method Summary
Modifier and TypeMethodDescriptionReturns the root directory where the sources are stored.default boolean
enabled()
Returns whether the directory described by this source element should be included in the build.default List<PathMatcher>
excludes()
Returns the list of pattern matchers for the files to exclude.default List<PathMatcher>
includes()
Returns the list of pattern matchers for the files to include.language()
Returns the language of the source files.module()
Returns the name of the Java module (or other language-specific module) which is built by the sources.default ProjectScope
scope()
Returns in which context the source files will be used.default boolean
Returns whether resources are filtered to replace tokens with parameterized values.Returns an explicit target path, overriding the default value.Returns the version of the platform where the code will be executed.
-
Method Details
-
directory
Path directory()Returns the root directory where the sources are stored.. The path is relative to the POM file.- Returns:
- the root directory where the sources are stored
-
includes
Returns the list of pattern matchers for the files to include.. The default implementation returns an empty list, which means to apply a language-dependent pattern. For example, for the Java language, the pattern includes all files with the.java
suffix.- Returns:
- the list of pattern matchers for the files to include
-
excludes
Returns the list of pattern matchers for the files to exclude.. The exclusions are applied after the inclusions. The default implementation returns an empty list.- Returns:
- the list of pattern matchers for the files to exclude
-
scope
Returns in which context the source files will be used.. The default value isProjectScope.MAIN
.- Returns:
- in which context the source files will be used
-
language
Language language()Returns the language of the source files..- Returns:
- the language of the source files
-
module
Returns the name of the Java module (or other language-specific module) which is built by the sources.. The default value is empty.- Returns:
- the name of the Java module (or other language-specific module) which is built by the sources
-
targetVersion
Returns the version of the platform where the code will be executed.. In a Java environment, this is the value of the--release
compiler option. The default value is empty.- Returns:
- the version of the platform where the code will be executed
-
targetPath
Returns an explicit target path, overriding the default value.. When a target path is explicitly specified, the values of themodule()
andtargetVersion()
elements are not used for inferring the path (they are still used as compiler options however). It means that for scripts and resources, the files below the path specified bydirectory()
are copied to the path specified bytargetPath()
with the exact same directory structure.- Returns:
- an explicit target path, overriding the default value
-
stringFiltering
default boolean stringFiltering()Returns whether resources are filtered to replace tokens with parameterized values.. The default value isfalse
.- Returns:
- whether resources are filtered to replace tokens with parameterized values
-
enabled
default boolean enabled()Returns whether the directory described by this source element should be included in the build.. The default value istrue
.- Returns:
- whether the directory described by this source element should be included in the build
-