Class Resource

All Implemented Interfaces:
Serializable, InputLocationTracker

This element describes all of the classpath resources associated with a project or unit tests.
See Also:
  • Constructor Details Link icon

  • Method Details Link icon

    • getTargetPath Link icon

      public String getTargetPath()
      Describe the resource target path. The path is relative to the target/classes directory (i.e. ${project.build.outputDirectory}). For example, if you want that resource to appear in a specific package (org.apache.maven.messages), you must specify this element with this value: org/apache/maven/messages. This is not required if you simply put the resources in that directory structure at the source, however.
      Returns:
      a String
    • getFiltering Link icon

      public String getFiltering()
      Whether resources are filtered to replace tokens with parameterised values or not. The values are taken from the properties element and from the properties in the files listed in the filters element. Note: While the type of this field is String for technical reasons, the semantic type is actually Boolean. Default value is false.
      Returns:
      a String
    • getMergeId Link icon

      public String getMergeId()
      FOR INTERNAL USE ONLY. This is a unique identifier assigned to each resource to allow Maven to merge changes to this resource that take place during the execution of a plugin. This field must be managed by the generated parser and formatter classes in order to allow it to survive model interpolation.
      Returns:
      a String
    • getLocation Link icon

      public InputLocation getLocation(Object key)
      Gets the location of the specified field in the input source.
      Specified by:
      getLocation in interface InputLocationTracker
      Overrides:
      getLocation in class FileSet
    • getLocationKeys Link icon

      public Set<Object> getLocationKeys()
      Gets the keys of the locations of the input source.
      Overrides:
      getLocationKeys in class FileSet
    • with Link icon

      @Nonnull public Resource.Builder with()
      Creates a new builder with this object as the basis.
      Overrides:
      with in class FileSet
      Returns:
      a Builder
    • withIncludes Link icon

      @Nonnull public Resource withIncludes(Collection<String> includes)
      Creates a new Resource instance using the specified includes.
      Overrides:
      withIncludes in class FileSet
      Parameters:
      includes - the new Collection<String> to use
      Returns:
      a Resource with the specified includes
    • withExcludes Link icon

      @Nonnull public Resource withExcludes(Collection<String> excludes)
      Creates a new Resource instance using the specified excludes.
      Overrides:
      withExcludes in class FileSet
      Parameters:
      excludes - the new Collection<String> to use
      Returns:
      a Resource with the specified excludes
    • withDirectory Link icon

      @Nonnull public Resource withDirectory(String directory)
      Creates a new Resource instance using the specified directory.
      Overrides:
      withDirectory in class FileSet
      Parameters:
      directory - the new String to use
      Returns:
      a Resource with the specified directory
    • withTargetPath Link icon

      @Nonnull public Resource withTargetPath(String targetPath)
      Creates a new Resource instance using the specified targetPath.
      Parameters:
      targetPath - the new String to use
      Returns:
      a Resource with the specified targetPath
    • withFiltering Link icon

      @Nonnull public Resource withFiltering(String filtering)
      Creates a new Resource instance using the specified filtering.
      Parameters:
      filtering - the new String to use
      Returns:
      a Resource with the specified filtering
    • withMergeId Link icon

      @Nonnull public Resource withMergeId(String mergeId)
      Creates a new Resource instance using the specified mergeId.
      Parameters:
      mergeId - the new String to use
      Returns:
      a Resource with the specified mergeId
    • newInstance Link icon

      @Nonnull public static Resource newInstance()
      Creates a new Resource instance. Equivalent to newInstance(true).
      Returns:
      a new Resource
      See Also:
    • newInstance Link icon

      @Nonnull public static Resource newInstance(boolean withDefaults)
      Creates a new Resource instance using default values or not. Equivalent to newBuilder(withDefaults).build().
      Parameters:
      withDefaults - the boolean indicating whether default values should be used
      Returns:
      a new Resource
    • newBuilder Link icon

      @Nonnull public static Resource.Builder newBuilder()
      Creates a new Resource builder instance. Equivalent to newBuilder(true).
      Returns:
      a new Builder
      See Also:
    • newBuilder Link icon

      @Nonnull public static Resource.Builder newBuilder(boolean withDefaults)
      Creates a new Resource builder instance using default values or not.
      Parameters:
      withDefaults - the boolean indicating whether default values should be used
      Returns:
      a new Builder
    • newBuilder Link icon

      @Nonnull public static Resource.Builder newBuilder(Resource from)
      Creates a new Resource builder instance using the specified object as a basis. Equivalent to newBuilder(from, false).
      Parameters:
      from - the Resource instance to use as a basis
      Returns:
      a new Builder
    • newBuilder Link icon

      @Nonnull public static Resource.Builder newBuilder(Resource from, boolean forceCopy)
      Creates a new Resource builder instance using the specified object as a basis.
      Parameters:
      from - the Resource instance to use as a basis
      forceCopy - the boolean indicating if a copy should be forced
      Returns:
      a new Builder
    • isFiltering Link icon

      public boolean isFiltering()
    • toString Link icon

      public String toString()
      Overrides:
      toString in class FileSet
      See Also: