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
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder 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.booleanstatic Resource.BuilderCreates a newResourcebuilder instance.static Resource.BuildernewBuilder(boolean withDefaults) Creates a newResourcebuilder instance using default values or not.static Resource.BuildernewBuilder(Resource from) Creates a newResourcebuilder instance using the specified object as a basis.static Resource.BuildernewBuilder(Resource from, boolean forceCopy) Creates a newResourcebuilder instance using the specified object as a basis.static ResourceCreates a newResourceinstance.static ResourcenewInstance(boolean withDefaults) Creates a newResourceinstance using default values or not.toString()with()Creates a new builder with this object as the basis.withDirectory(String directory) Creates a newResourceinstance using the specified directory.withExcludes(Collection<String> excludes) Creates a newResourceinstance using the specified excludes.withFiltering(String filtering) Creates a newResourceinstance using the specified filtering.withIncludes(Collection<String> includes) Creates a newResourceinstance using the specified includes.withMergeId(String mergeId) Creates a newResourceinstance using the specified mergeId.withTargetPath(String targetPath) Creates a newResourceinstance using the specified targetPath.Methods inherited from class org.apache.maven.api.model.FileSet
getDirectory, newBuilder, newBuilderMethods inherited from class org.apache.maven.api.model.PatternSet
getExcludes, getIncludes, getLocation, newBuilder, newBuilderMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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 thepropertieselement and from the properties in the files listed in thefilterselement. Note: While the type of this field isStringfor 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 newResourceinstance using the specified includes.- Overrides:
withIncludesin classFileSet- Parameters:
includes- the newCollection<String>to use- Returns:
- a
Resourcewith the specified includes
-
withExcludes
Creates a newResourceinstance using the specified excludes.- Overrides:
withExcludesin classFileSet- Parameters:
excludes- the newCollection<String>to use- Returns:
- a
Resourcewith the specified excludes
-
withDirectory
Creates a newResourceinstance using the specified directory.- Overrides:
withDirectoryin classFileSet- Parameters:
directory- the newStringto use- Returns:
- a
Resourcewith the specified directory
-
withTargetPath
Creates a newResourceinstance using the specified targetPath.- Parameters:
targetPath- the newStringto use- Returns:
- a
Resourcewith the specified targetPath
-
withFiltering
Creates a newResourceinstance using the specified filtering.- Parameters:
filtering- the newStringto use- Returns:
- a
Resourcewith the specified filtering
-
withMergeId
Creates a newResourceinstance using the specified mergeId.- Parameters:
mergeId- the newStringto use- Returns:
- a
Resourcewith the specified mergeId
-
newInstance
Creates a newResourceinstance. Equivalent tonewInstance(true).- Returns:
- a new
Resource - See Also:
-
newInstance
Creates a newResourceinstance 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 newResourcebuilder instance. Equivalent tonewBuilder(true).- Returns:
- a new
Builder - See Also:
-
newBuilder
Creates a newResourcebuilder instance using default values or not.- Parameters:
withDefaults- the boolean indicating whether default values should be used- Returns:
- a new
Builder
-
newBuilder
Creates a newResourcebuilder instance using the specified object as a basis. Equivalent tonewBuilder(from, false).- Parameters:
from- theResourceinstance to use as a basis- Returns:
- a new
Builder
-
newBuilder
Creates a newResourcebuilder instance using the specified object as a basis.- Parameters:
from- theResourceinstance to use as a basisforceCopy- the boolean indicating if a copy should be forced- Returns:
- a new
Builder
-
isFiltering
public boolean isFiltering() -
toString
-