java.lang.Object
org.apache.maven.buildcache.xml.config.Exclude
All Implemented Interfaces:
Serializable

public class Exclude extends Object implements Serializable

A file or a directory path to exclude from the checksum computation. Relative path are relative to each module basedir.

When referring to a directory, additional properties help adjust the scope of the exclusion:
  • glob - only entries matching this glob pattern are excluded
  • entryType - type of entries excluded from the scan
  • matcherType - entry property on which the glob matching is applied

By default, targeting a directory excludes everything underneath it.

Examples :
  • <exclude>src/main/doc</exclude> : excludes everything under : ${project.basedir}/src/main/doc
  • <exclude>src/main/java/package-info.java</exclude> : excludes this file : ${project.basedir}/src/main/java/package-info.java
  • <exclude glob="package-info.java"></exclude> : excludes all the files named package-info.java
  • <exclude glob="src/main/resources/**.txt" entryType="FILE" matcherType="PATH" ></exclude> : excludes all the text files located under the "resources" folder

Exclude elements can also be added per project with the use of maven properties.

Version:
$Revision$ $Date$
See Also:
  • Constructor Details

    • Exclude

      public Exclude()
  • Method Details

    • getEntryType

      public String getEntryType()
      Get type of entries filtered. One of FILE, DIRECTORY, ALL. Excluding a directory excludes its subfiles and subdirectories.
      Returns:
      String
    • getGlob

      public String getGlob()
      Get entries are filtered by matching this glob (see matcherType property).
      Returns:
      String
    • getMatcherType

      public String getMatcherType()
      Get the entry property matched for exclusion. One of FILENAME, PATH. For a path, if the exclusion value is empty or a relative path, matching is done relatively to the project folder.
      Returns:
      String
    • getValue

      public String getValue()
      Get an absolute or relative path to a filename or a directory. In the later case, the exclusion is applied starting from this directory (can be beneficial in term of performances). If empty, the glob is applied on every file listed as a potential part of the checksum.
      Returns:
      String
    • setEntryType

      public void setEntryType(String entryType)
      Set type of entries filtered. One of FILE, DIRECTORY, ALL. Excluding a directory excludes its subfiles and subdirectories.
      Parameters:
      entryType - a entryType object.
    • setGlob

      public void setGlob(String glob)
      Set entries are filtered by matching this glob (see matcherType property).
      Parameters:
      glob - a glob object.
    • setMatcherType

      public void setMatcherType(String matcherType)
      Set the entry property matched for exclusion. One of FILENAME, PATH. For a path, if the exclusion value is empty or a relative path, matching is done relatively to the project folder.
      Parameters:
      matcherType - a matcherType object.
    • setValue

      public void setValue(String value)
      Set an absolute or relative path to a filename or a directory. In the later case, the exclusion is applied starting from this directory (can be beneficial in term of performances). If empty, the glob is applied on every file listed as a potential part of the checksum.
      Parameters:
      value - a value object.