resources:copy-resources

Full name:

org.apache.maven.plugins:maven-resources-plugin:3.0.2:copy-resources

Description:

Copy resources of the configured plugin attribute resources

Attributes:

  • Requires a Maven project to be executed.
  • The goal is thread-safe and supports parallel builds.
  • Since version: 2.3.

Required Parameters

Name Type Since Description
outputDirectory File 2.3 The output directory into which to copy the resources.
resources List 2.3 The list of resources we want to transfer. See the Maven Model for a description of how to code the resources element.

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.
  • 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, **/.gitignore, **/.gitattributes, **/.git/**
  • Bitkeeper: **/BitKeeper, **/BitKeeper/**, **/ChangeSet, **/ChangeSet/**
  • Darcs: **/_darcs, **/_darcs/**, **/.darcsrepo, **/.darcsrepo/****/-darcs-backup*, **/.darcs-temp-mail

Default value is: true.
delimiters LinkedHashSet 2.4

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).


encoding String 2.3 The character encoding scheme to be applied when filtering resources.
Default value is: ${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 value is: true.
fileNameFiltering boolean 3.0.0 Support filtering of filenames folders etc.
Default value is: false.
filters List 2.3 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.
includeEmptyDirs boolean 2.3 Copy any empty directories included in the Resources.
Default value is: false.
mavenFilteringHints List 2.4

List of plexus components hint which implements MavenResourcesFiltering.filterResources(). They will be executed after the resources copying/filtering.


nonFilteredFileExtensions List 2.3 Additional file extensions to not apply filtering (already defined are : jpg, jpeg, gif, bmp, png)
overwrite boolean 2.3 Overwrite existing files even if the destination files are newer.
Default value is: false.
skip boolean 3.0.0 You can skip the execution of the plugin if you need to. Its use is NOT RECOMMENDED, but quite convenient on occasion.
Default value is: false.
User property is: maven.resources.skip.
supportMultiLineFiltering boolean 2.5 stop searching endToken at the end of line
Default value is: 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: ResourcesMojo.buildFilters and ResourcesMojo.filters
Default value is: true.
useDefaultDelimiters boolean 2.4 Use default delimiters in addition to custom delimiters, if any.
Default value is: true.

Parameter Details

addDefaultExcludes:

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.
  • 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, **/.gitignore, **/.gitattributes, **/.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

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
  • Since: 2.4
  • Required: No

encoding:

The character encoding scheme to be applied when filtering resources.
  • Type: java.lang.String
  • Since: 2.3
  • Required: No
  • Default: ${project.build.sourceEncoding}

escapeString:

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.
  • Type: java.lang.String
  • Since: 2.3
  • Required: No

escapeWindowsPaths:

Whether to escape backslashes and colons in windows-style paths.
  • Type: boolean
  • Since: 2.4
  • Required: No
  • Default: true

fileNameFiltering:

Support filtering of filenames folders etc.
  • 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
  • Since: 2.3
  • Required: No

includeEmptyDirs:

Copy any empty directories included in the Resources.
  • Type: boolean
  • Since: 2.3
  • Required: No
  • Default: false

mavenFilteringHints:

List of plexus components hint which implements MavenResourcesFiltering.filterResources(). They will be executed after the resources copying/filtering.

  • Type: java.util.List
  • Since: 2.4
  • Required: No

nonFilteredFileExtensions:

Additional file extensions to not apply filtering (already defined are : jpg, jpeg, gif, bmp, png)
  • Type: java.util.List
  • Since: 2.3
  • Required: No

outputDirectory:

The output directory into which to copy the resources.
  • Type: java.io.File
  • Since: 2.3
  • Required: Yes

overwrite:

Overwrite existing files even if the destination files are newer.
  • Type: boolean
  • Since: 2.3
  • Required: No
  • Default: false

resources:

The list of resources we want to transfer. See the Maven Model for a description of how to code the resources element.
  • Type: java.util.List
  • Since: 2.3
  • Required: Yes

skip:

You can skip the execution of the plugin if you need to. Its use is NOT RECOMMENDED, but quite convenient on occasion.
  • Type: boolean
  • Since: 3.0.0
  • Required: No
  • User Property: maven.resources.skip
  • Default: false

supportMultiLineFiltering:

stop searching endToken at the end of line
  • Type: boolean
  • Since: 2.5
  • Required: No
  • Default: false

useBuildFilters:

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: ResourcesMojo.buildFilters and ResourcesMojo.filters
  • Type: boolean
  • Since: 2.4
  • Required: No
  • Default: true

useDefaultDelimiters:

Use default delimiters in addition to custom delimiters, if any.
  • Type: boolean
  • Since: 2.4
  • Required: No
  • Default: true