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 Type
    Method
    Description
    Returns the root directory where the sources are stored.
    default boolean
    Returns whether the directory described by this source element should be included in the build.
    default List<PathMatcher>
    Returns the list of pattern matchers for the files to exclude.
    default List<PathMatcher>
    Returns the list of pattern matchers for the files to include.
    Returns the language of the source files.
    default Optional<String>
    Returns the name of the Java module (or other language-specific module) which is built by the sources.
    default ProjectScope
    Returns in which context the source files will be used.
    default boolean
    Returns whether resources are filtered to replace tokens with parameterized values.
    default Optional<Path>
    Returns an explicit target path, overriding the default value.
    default Optional<Version>
    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

      default List<PathMatcher> 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

      default List<PathMatcher> 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

      default ProjectScope scope()
      Returns in which context the source files will be used.. The default value is ProjectScope.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

      default Optional<String> 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

      default Optional<Version> 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

      default Optional<Path> targetPath()
      Returns an explicit target path, overriding the default value.. When a target path is explicitly specified, the values of the module() and targetVersion() 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 by directory() are copied to the path specified by targetPath() 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 is false.
      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 is true.
      Returns:
      whether the directory described by this source element should be included in the build