org.apache.maven.plugin.resources
Class ResourcesMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.apache.maven.plugin.resources.ResourcesMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
Direct Known Subclasses:
CopyResourcesMojo, TestResourcesMojo

public class ResourcesMojo
extends org.apache.maven.plugin.AbstractMojo

Copy resources for the main source code to the main output directory.

Version:
$Id: ResourcesMojo.java 943020 2010-05-11 06:53:57Z krosenvold $
Author:
Michal Maczka, Jason van Zyl, Andreas Hoheneder, William Ferguson
Is defined by the goal name:
resources
Is bound to the specified phase of the standard build lifecycle:
process-resources

Field Summary
protected  List buildFilters
          The list of additional filter properties files to be used along with System and project properties, which would be used for the filtering.
protected  List delimiters
           Set of delimiters for expressions to filter within the resources.
protected  String encoding
          The character encoding scheme to be applied when filtering resources.
protected  String escapeString
          Expression preceded with the String won't be interpolated \${foo} will be replaced with ${foo}
protected  boolean escapeWindowsPaths
          Whether to escape backslashes and colons in windows-style paths.
protected  List 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.
protected  boolean includeEmptyDirs
          Copy any empty directories included in the Ressources.
protected  org.apache.maven.shared.filtering.MavenResourcesFiltering mavenResourcesFiltering
           
protected  List nonFilteredFileExtensions
          Additionnal file extensions to not apply filtering (already defined are : jpg, jpeg, gif, bmp, png)
protected  org.apache.maven.project.MavenProject project
           
protected  org.apache.maven.execution.MavenSession session
           
protected  boolean useBuildFilters
          If false, don't use the filters specified in the build/filters section of the POM when processing resources in this mojo execution.
protected  boolean useDefaultDelimiters
           
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
ResourcesMojo()
           
 
Method Summary
 void execute()
           
protected  List getCombinedFiltersList()
           
 List getDelimiters()
           
 List getFilters()
           
 File getOutputDirectory()
           
 List getResources()
           
 boolean isIncludeEmptyDirs()
           
 boolean isOverwrite()
           
 boolean isUseDefaultDelimiters()
           
 void setDelimiters(List delimiters)
           
 void setFilters(List filters)
           
 void setIncludeEmptyDirs(boolean includeEmptyDirs)
           
 void setOutputDirectory(File outputDirectory)
           
 void setOverwrite(boolean overwrite)
           
 void setResources(List resources)
           
 void setUseDefaultDelimiters(boolean useDefaultDelimiters)
           
 
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

encoding

protected String encoding
The character encoding scheme to be applied when filtering resources.

Is defined by:
expression:
${encoding}
default-value:
${project.build.sourceEncoding}

project

protected org.apache.maven.project.MavenProject project
Is defined by:
default-value:
${project}
Is readonly.
Is required.

buildFilters

protected List buildFilters
The list of additional filter properties files to be used along with System and project properties, which would be used for the filtering.
See also: filters.

Since:
2.4
Is defined by:
default-value:
${project.build.filters}
Is readonly.

filters

protected List 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.

Is defined by:

useBuildFilters

protected boolean 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: buildFilters and filters

Since:
2.4
Is defined by:
default-value:
true

mavenResourcesFiltering

protected org.apache.maven.shared.filtering.MavenResourcesFiltering mavenResourcesFiltering
Is a Plexus component defined by:
role:
org.apache.maven.shared.filtering.MavenResourcesFiltering
role-hint:
default
Is required.

session

protected org.apache.maven.execution.MavenSession session
Is defined by:
default-value:
${session}
Is readonly.
Is required.

escapeString

protected String escapeString
Expression preceded with the String won't be interpolated \${foo} will be replaced with ${foo}

Since:
2.3
Is defined by:
default-value:
${maven.resources.escapeString}

includeEmptyDirs

protected boolean includeEmptyDirs
Copy any empty directories included in the Ressources.

Since:
2.3
Is defined by:
expression:
${maven.resources.includeEmptyDirs}
default-value:
false

nonFilteredFileExtensions

protected List nonFilteredFileExtensions
Additionnal file extensions to not apply filtering (already defined are : jpg, jpeg, gif, bmp, png)

Since:
2.3
Is defined by:

escapeWindowsPaths

protected boolean escapeWindowsPaths
Whether to escape backslashes and colons in windows-style paths.

Since:
2.4
Is defined by:
expression:
${maven.resources.escapeWindowsPaths}
default-value:
true

delimiters

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

Since:
2.4
Is defined by:

useDefaultDelimiters

protected boolean useDefaultDelimiters
Since:
2.4
Is defined by:
default-value:
true
Constructor Detail

ResourcesMojo

public ResourcesMojo()
Method Detail

execute

public void execute()
             throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException

getCombinedFiltersList

protected List getCombinedFiltersList()

getResources

public List getResources()

setResources

public void setResources(List resources)

getOutputDirectory

public File getOutputDirectory()

setOutputDirectory

public void setOutputDirectory(File outputDirectory)

isOverwrite

public boolean isOverwrite()

setOverwrite

public void setOverwrite(boolean overwrite)

isIncludeEmptyDirs

public boolean isIncludeEmptyDirs()

setIncludeEmptyDirs

public void setIncludeEmptyDirs(boolean includeEmptyDirs)

getFilters

public List getFilters()

setFilters

public void setFilters(List filters)

getDelimiters

public List getDelimiters()

setDelimiters

public void setDelimiters(List delimiters)

isUseDefaultDelimiters

public boolean isUseDefaultDelimiters()

setUseDefaultDelimiters

public void setUseDefaultDelimiters(boolean useDefaultDelimiters)


Copyright © 2001-2010 The Apache Software Foundation. All Rights Reserved.