Package org.apache.maven.api.model
Class Resource
java.lang.Object
org.apache.maven.api.model.PatternSet
org.apache.maven.api.model.FileSet
org.apache.maven.api.model.Resource
- All Implemented Interfaces:
Serializable
,InputLocationTracker
@Experimental
@Generated
@ThreadSafe
@Immutable
public class Resource
extends FileSet
implements Serializable, InputLocationTracker
This element describes all of the classpath resources associated with a project
or unit tests.
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Builder class used to create Resource instances. -
Method Summary
Modifier and TypeMethodDescriptionWhether resources are filtered to replace tokens with parameterised values or not.FOR INTERNAL USE ONLY.Describe the resource target path.boolean
static Resource.Builder
Creates a newResource
builder instance.static Resource.Builder
newBuilder
(boolean withDefaults) Creates a newResource
builder instance using default values or not.static Resource.Builder
newBuilder
(Resource from) Creates a newResource
builder instance using the specified object as a basis.static Resource.Builder
newBuilder
(Resource from, boolean forceCopy) Creates a newResource
builder instance using the specified object as a basis.static Resource
Creates a newResource
instance.static Resource
newInstance
(boolean withDefaults) Creates a newResource
instance using default values or not.toString()
with()
Creates a new builder with this object as the basis.withDirectory
(String directory) Creates a newResource
instance using the specified directory.withExcludes
(Collection<String> excludes) Creates a newResource
instance using the specified excludes.withFiltering
(String filtering) Creates a newResource
instance using the specified filtering.withIncludes
(Collection<String> includes) Creates a newResource
instance using the specified includes.withMergeId
(String mergeId) Creates a newResource
instance using the specified mergeId.withTargetPath
(String targetPath) Creates a newResource
instance using the specified targetPath.Methods inherited from class org.apache.maven.api.model.FileSet
getDirectory, newBuilder, newBuilder
Methods inherited from class org.apache.maven.api.model.PatternSet
getExcludes, getIncludes, getLocation, newBuilder, newBuilder
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.maven.api.model.InputLocationTracker
getLocation
-
Method Details
-
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
Whether resources are filtered to replace tokens with parameterised values or not. The values are taken from theproperties
element and from the properties in the files listed in thefilters
element. Note: While the type of this field isString
for technical reasons, the semantic type is actuallyBoolean
. Default value isfalse
.- Returns:
- a
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
-
with
Creates a new builder with this object as the basis. -
withIncludes
Creates a newResource
instance using the specified includes.- Overrides:
withIncludes
in classFileSet
- Parameters:
includes
- the newCollection<String>
to use- Returns:
- a
Resource
with the specified includes
-
withExcludes
Creates a newResource
instance using the specified excludes.- Overrides:
withExcludes
in classFileSet
- Parameters:
excludes
- the newCollection<String>
to use- Returns:
- a
Resource
with the specified excludes
-
withDirectory
Creates a newResource
instance using the specified directory.- Overrides:
withDirectory
in classFileSet
- Parameters:
directory
- the newString
to use- Returns:
- a
Resource
with the specified directory
-
withTargetPath
Creates a newResource
instance using the specified targetPath.- Parameters:
targetPath
- the newString
to use- Returns:
- a
Resource
with the specified targetPath
-
withFiltering
Creates a newResource
instance using the specified filtering.- Parameters:
filtering
- the newString
to use- Returns:
- a
Resource
with the specified filtering
-
withMergeId
Creates a newResource
instance using the specified mergeId.- Parameters:
mergeId
- the newString
to use- Returns:
- a
Resource
with the specified mergeId
-
newInstance
Creates a newResource
instance. Equivalent tonewInstance( true )
.- Returns:
- a new
Resource
- See Also:
-
newInstance
Creates a newResource
instance using default values or not. Equivalent tonewBuilder( withDefaults ).build()
.- Parameters:
withDefaults
- the boolean indicating whether default values should be used- Returns:
- a new
Resource
-
newBuilder
Creates a newResource
builder instance. Equivalent tonewBuilder( true )
.- Returns:
- a new
Builder
- See Also:
-
newBuilder
Creates a newResource
builder instance using default values or not.- Parameters:
withDefaults
- the boolean indicating whether default values should be used- Returns:
- a new
Builder
-
newBuilder
Creates a newResource
builder instance using the specified object as a basis. Equivalent tonewBuilder( from, false )
.- Parameters:
from
- theResource
instance to use as a basis- Returns:
- a new
Builder
-
newBuilder
Creates a newResource
builder instance using the specified object as a basis.- Parameters:
from
- theResource
instance to use as a basisforceCopy
- the boolean indicating if a copy should be forced- Returns:
- a new
Builder
-
isFiltering
public boolean isFiltering() -
toString
-