resources:testResources
Full name:
org.apache.maven.plugins:maven-resources-plugin:3.5.0:testResources
Description:
Copy resources for the test source code to the test output directory. Always uses the project.build.testResources element to specify the resources to copy.
Attributes:
- Requires a Maven project to be executed.
- The goal is thread-safe and supports parallel builds.
- Binds by default to the lifecycle phase:
process-test-resources.
Required Parameters
| Name | Type | Since | Description |
|---|---|---|---|
<outputDirectory> |
File |
- |
The output directory into which to copy the resources. Default: ${project.build.testOutputDirectory} |
<resources> |
List<Resource> |
- |
The list of resources we want to transfer. Default: ${project.testResources} |
Optional Parameters
| Name | Type | Since | Description |
|---|---|---|---|
<addDefaultExcludes> |
boolean |
3.0.0 |
By default files like .gitignore, .cvsignore etc. are excluded which means they will not being copied. If you need them for a particular reason you can do that by settings this to false. This means all files like the following will be copied.
Default: true |
<changeDetection> |
String |
3.5.0 |
The strategy to use for change detection. Supported values are listed below. If this parameter is configured, it will override the value of overwrite. Strategies and their behavior are as follows:
|
<delimiters> |
LinkedHashSet<String> |
2.4 |
Set of delimiters for expressions to filter within the resources. These delimiters are specified in the form So, the default filtering delimiters might be specified as: <delimiters>
<delimiter>${*}</delimiter>
<delimiter>@</delimiter>
</delimiters>
Since the |
<encoding> |
String |
- |
The character encoding to use when reading and writing filtered resources. Default: ${project.build.sourceEncoding} |
<escapeString> |
String |
2.3 |
Expressions preceded with this string won't be interpolated. Anything else preceded with this string will be passed through unchanged. For example \${foo} will be replaced with ${foo} but \\${foo} will be replaced with \\value of foo, if this parameter has been set to the backslash. |
<escapeWindowsPaths> |
boolean |
2.4 |
Whether to escape backslashes and colons in windows-style paths. Default: true |
<fileNameFiltering> |
boolean |
3.0.0 |
Support filtering of filenames folders etc. Default: false |
<filters> |
List<String> |
- |
The list of extra filter properties files to be used along with System properties, project properties, and filter properties files specified in the POM build/filters section, which should be used for the filtering during the current mojo execution. Normally, these will be configured from a plugin's execution section, to provide a different set of filters for a particular execution. For instance, starting in Maven 2.2.0, you have the option of configuring executions with the id's |
<includeEmptyDirs> |
boolean |
2.3 |
Copy any empty directories included in the Resources. Default: false |
<mavenFilteringHints> |
List<String> |
2.4 |
List of plexus components hint which implements |
<nonFilteredFileExtensions> |
List<String> |
2.3 |
Additional file extensions to not apply filtering (already defined are : jpg, jpeg, gif, bmp, png) |
<overwrite> |
boolean |
2.3 |
Deprecated. Use changeDetection instead.Overwrite existing files even if the destination files are newer. Default: false |
<propertiesEncoding> |
String |
3.2.0 |
The character encoding to use when reading and writing filtered properties files. If not specified, it will default to the value of the "encoding" parameter. |
<skip> |
boolean |
2.6 |
Set this to 'true' to bypass copying of test resources. Its use is NOT RECOMMENDED, but quite convenient on occasion. Default: falseUser Property: maven.test.skip |
<supportMultiLineFiltering> |
boolean |
2.5 |
stop searching endToken at the end of line Default: false |
<useBuildFilters> |
boolean |
2.4 |
If false, don't use the filters specified in the build/filters section of the POM when processing resources in this mojo execution. See also: buildFilters, filters Default: true |
<useDefaultDelimiters> |
boolean |
2.4 |
Use default delimiters in addition to custom delimiters, if any. Default: true |
Parameter Details
<addDefaultExcludes>
.gitignore, .cvsignore etc. are excluded which means they will not being copied. If you need them for a particular reason you can do that by settings this to false. This means all files like the following will be copied.
- Misc: **/*~, **/#*#, **/.#*, **/%*%, **/._*
- CVS: **/CVS, **/CVS/**, **/.cvsignore
- RCS: **/RCS, **/RCS/**
- SCCS: **/SCCS, **/SCCS/**
- VSSercer: **/vssver.scc
- MKS: **/project.pj
- SVN: **/.svn, **/.svn/**
- GNU: **/.arch-ids, **/.arch-ids/**
- Bazaar: **/.bzr, **/.bzr/**
- SurroundSCM: **/.MySCMServerInfo
- Mac: **/.DS_Store
- Serena Dimension: **/.metadata, **/.metadata/**
- Mercurial: **/.hg, **/.hg/**
- Git: **/.git, **/.git/**
- Bitkeeper: **/BitKeeper, **/BitKeeper/**, **/ChangeSet, **/ChangeSet/**
- Darcs: **/_darcs, **/_darcs/**, **/.darcsrepo, **/.darcsrepo/****/-darcs-backup*, **/.darcs-temp-mail
- Type:
boolean - Since:
3.0.0 - Required:
No - Default:
true
<changeDetection>
overwrite. Strategies and their behavior are as follows:
- content: This is the default strategy since version 3.4.0. Overwrites existing target file only if content differs.
- timestamp: This was the default strategy before version 3.4.0. Overwrites existing target file only if target timestamp is older than source timestamp.
- timestamp+content: Combines the two strategies above; if timestamp is older and if content differs, existing target file will be overwritten.
- always: Always overwrites existing target file. Equivalent of
overwrite=true. - never: Never overwrites existing target file.
- Type:
java.lang.String - Since:
3.5.0 - Required:
No
<delimiters>
Set of delimiters for expressions to filter within the resources. These delimiters are specified in the form beginToken*endToken. If no * is given, the delimiter is assumed to be the same for start and end.
So, the default filtering delimiters might be specified as:
<delimiters>
<delimiter>${*}</delimiter>
<delimiter>@</delimiter>
</delimiters>
Since the @ delimiter is the same on both ends, we don't need to specify @*@ (though we can).
- Type:
java.util.LinkedHashSet<java.lang.String> - Since:
2.4 - Required:
No
<encoding>
- Type:
java.lang.String - Required:
No - Default:
${project.build.sourceEncoding}
<escapeString>
\${foo} will be replaced with ${foo} but \\${foo} will be replaced with \\value of foo, if this parameter has been set to the backslash.- Type:
java.lang.String - Since:
2.3 - Required:
No
<escapeWindowsPaths>
- Type:
boolean - Since:
2.4 - Required:
No - Default:
true
<fileNameFiltering>
- Type:
boolean - Since:
3.0.0 - Required:
No - Default:
false
<filters>
The list of extra filter properties files to be used along with System properties, project properties, and filter properties files specified in the POM build/filters section, which should be used for the filtering during the current mojo execution.
Normally, these will be configured from a plugin's execution section, to provide a different set of filters for a particular execution. For instance, starting in Maven 2.2.0, you have the option of configuring executions with the id's default-resources and default-testResources to supply different configurations for the two different types of resources. By supplying extraFilters configurations, you can separate which filters are used for which type of resource.
- Type:
java.util.List<java.lang.String> - Required:
No
<includeEmptyDirs>
- Type:
boolean - Since:
2.3 - Required:
No - Default:
false
<mavenFilteringHints>
List of plexus components hint which implements org.apache.maven.shared.filtering.MavenResourcesFiltering.filterResources(org.apache.maven.shared.filtering.MavenResourcesExecution). They will be executed after the resources copying/filtering.
- Type:
java.util.List<java.lang.String> - Since:
2.4 - Required:
No
<nonFilteredFileExtensions>
- Type:
java.util.List<java.lang.String> - Since:
2.3 - Required:
No
<outputDirectory>
- Type:
java.io.File - Required:
Yes - Default:
${project.build.testOutputDirectory}
<overwrite>
Use
changeDetection instead.- Type:
boolean - Since:
2.3 - Required:
No - Default:
false
<propertiesEncoding>
- Type:
java.lang.String - Since:
3.2.0 - Required:
No
<resources>
- Type:
java.util.List<org.apache.maven.model.Resource> - Required:
Yes - Default:
${project.testResources}
<skip>
- Type:
boolean - Since:
2.6 - Required:
No - User Property:
maven.test.skip - Default:
false
<supportMultiLineFiltering>
- Type:
boolean - Since:
2.5 - Required:
No - Default:
false
<useBuildFilters>
See also: buildFilters, filters
- Type:
boolean - Since:
2.4 - Required:
No - Default:
true
<useDefaultDelimiters>
- Type:
boolean - Since:
2.4 - Required:
No - Default:
true


