Package org.apache.maven.impl
Class DefaultSourceRoot
java.lang.Object
org.apache.maven.impl.DefaultSourceRoot
- All Implemented Interfaces:
SourceRoot
A default implementation of
SourceRoot built from the model.-
Constructor Summary
ConstructorsConstructorDescriptionDefaultSourceRoot(Path baseDir, ProjectScope scope, Resource resource) Creates a new instance from the given resource.DefaultSourceRoot(ProjectScope scope, Language language, Path directory) Creates a new instance for the given directory and scope.DefaultSourceRoot(ProjectScope scope, Language language, Path directory, List<PathMatcher> includes, List<PathMatcher> excludes) Creates a new instance for the given directory and scope.DefaultSourceRoot(Session session, Path baseDir, Source source) Creates a new instance from the given model. -
Method Summary
Modifier and TypeMethodDescriptionReturns the root directory where the sources are stored.booleanenabled()Returns whether the directory described by this source element should be included in the build.booleanReturns whether the two objects are of the same class with equal property values.excludes()Returns the list of pattern matchers for the files to exclude.inthashCode()Returns a hash code value computed from all properties.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.scope()Returns in which context the source files will be used.booleanReturns 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.
-
Constructor Details
-
DefaultSourceRoot
Creates a new instance from the given model.- Parameters:
session- the session of resolving extensible enumerationsbaseDir- the base directory for resolving relative pathssource- a source element from the model
-
DefaultSourceRoot
Creates a new instance from the given resource. This is used for migration from the previous way of declaring resources.- Parameters:
baseDir- the base directory for resolving relative pathsscope- the scope of the resource (main or test)resource- a resource element from the model
-
DefaultSourceRoot
Creates a new instance for the given directory and scope.- Parameters:
scope- scope of source code (main or test)language- language of the source codedirectory- directory of the source code
-
DefaultSourceRoot
public DefaultSourceRoot(ProjectScope scope, Language language, Path directory, List<PathMatcher> includes, List<PathMatcher> excludes) Creates a new instance for the given directory and scope.- Parameters:
scope- scope of source code (main or test)language- language of the source codedirectory- directory of the source code
-
-
Method Details
-
directory
Returns the root directory where the sources are stored..- Specified by:
directoryin interfaceSourceRoot- Returns:
- the root directory where the sources are stored
-
includes
Returns the list of pattern matchers for the files to include..- Specified by:
includesin interfaceSourceRoot- Returns:
- the list of pattern matchers for the files to include
-
excludes
Returns the list of pattern matchers for the files to exclude..- Specified by:
excludesin interfaceSourceRoot- Returns:
- the list of pattern matchers for the files to exclude
-
scope
Returns in which context the source files will be used..- Specified by:
scopein interfaceSourceRoot- Returns:
- in which context the source files will be used
-
language
Returns the language of the source files..- Specified by:
languagein interfaceSourceRoot- 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..- Specified by:
modulein interfaceSourceRoot- 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..- Specified by:
targetVersionin interfaceSourceRoot- Returns:
- the version of the platform where the code will be executed
-
targetPath
Returns an explicit target path, overriding the default value..- Specified by:
targetPathin interfaceSourceRoot- Returns:
- an explicit target path, overriding the default value
-
stringFiltering
public boolean stringFiltering()Returns whether resources are filtered to replace tokens with parameterized values..- Specified by:
stringFilteringin interfaceSourceRoot- Returns:
- whether resources are filtered to replace tokens with parameterized values
-
enabled
public boolean enabled()Returns whether the directory described by this source element should be included in the build..- Specified by:
enabledin interfaceSourceRoot- Returns:
- whether the directory described by this source element should be included in the build
-
hashCode
public int hashCode()Returns a hash code value computed from all properties.. -
equals
Returns whether the two objects are of the same class with equal property values..
-