@Mojo(name="resources", defaultPhase=PROCESS_RESOURCES, threadSafe=true) public class ResourcesMojo extends AbstractMojo implements org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable
Modifier and Type | Field and Description |
---|---|
protected List<String> |
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<String> |
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<String> |
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 Resources.
|
protected MavenResourcesFiltering |
mavenResourcesFiltering |
protected List<String> |
nonFilteredFileExtensions
Additional file extensions to not apply filtering (already defined are : jpg, jpeg, gif, bmp, png)
|
protected MavenProject |
project |
protected 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 |
Constructor and Description |
---|
ResourcesMojo() |
Modifier and Type | Method and Description |
---|---|
void |
contextualize(org.codehaus.plexus.context.Context context) |
void |
execute() |
protected void |
executeUserFilterComponents(MavenResourcesExecution mavenResourcesExecution) |
protected List<String> |
getCombinedFiltersList() |
List<String> |
getDelimiters() |
List<String> |
getFilters() |
File |
getOutputDirectory() |
List<Resource> |
getResources() |
boolean |
isIncludeEmptyDirs() |
boolean |
isOverwrite() |
boolean |
isUseDefaultDelimiters() |
void |
setDelimiters(List<String> delimiters) |
void |
setFilters(List<String> filters) |
void |
setIncludeEmptyDirs(boolean includeEmptyDirs) |
void |
setOutputDirectory(File outputDirectory) |
void |
setOverwrite(boolean overwrite) |
void |
setResources(List<Resource> resources) |
void |
setUseDefaultDelimiters(boolean useDefaultDelimiters) |
getLog, getPluginContext, setLog, setPluginContext
@Parameter(property="encoding", defaultValue="${project.build.sourceEncoding}") protected String encoding
@Parameter(defaultValue="${project}", readonly=true, required=true) protected MavenProject project
@Parameter(defaultValue="${project.build.filters}", readonly=true) protected List<String> buildFilters
filters
.@Parameter protected List<String> filters
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.@Parameter(defaultValue="true") protected boolean useBuildFilters
buildFilters
and filters
@Component(role=org.apache.maven.shared.filtering.MavenResourcesFiltering.class, hint="default") protected MavenResourcesFiltering mavenResourcesFiltering
@Parameter(defaultValue="${session}", readonly=true, required=true) protected MavenSession session
@Parameter(property="maven.resources.escapeString") protected String escapeString
@Parameter(property="maven.resources.includeEmptyDirs", defaultValue="false") protected boolean includeEmptyDirs
@Parameter protected List<String> nonFilteredFileExtensions
@Parameter(property="maven.resources.escapeWindowsPaths", defaultValue="true") protected boolean escapeWindowsPaths
@Parameter protected List<String> 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).
@Parameter(defaultValue="true") protected boolean useDefaultDelimiters
public void contextualize(org.codehaus.plexus.context.Context context) throws org.codehaus.plexus.context.ContextException
contextualize
in interface org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable
org.codehaus.plexus.context.ContextException
public void execute() throws MojoExecutionException
execute
in interface Mojo
MojoExecutionException
protected void executeUserFilterComponents(MavenResourcesExecution mavenResourcesExecution) throws MojoExecutionException, MavenFilteringException
MojoExecutionException
MavenFilteringException
public File getOutputDirectory()
public void setOutputDirectory(File outputDirectory)
public boolean isOverwrite()
public void setOverwrite(boolean overwrite)
public boolean isIncludeEmptyDirs()
public void setIncludeEmptyDirs(boolean includeEmptyDirs)
public boolean isUseDefaultDelimiters()
public void setUseDefaultDelimiters(boolean useDefaultDelimiters)
Copyright © 2001–2014 The Apache Software Foundation. All rights reserved.