You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

Goal

Currently some plugins duplicates/modify classes coming the ressources plugin or build their own to handle (copy and filtering) resources.
A common component could provide a common way for all plugins which needs to filtering resources.

This component will apply filtering on a List of org.apache.maven.model.Resource.

The method without the filterWrappers parameter will interpolate the files using the default List of FileUtils.FilterWrapper (see above).

The component will not filtering some predefined file extensions (jpg,jpeg,gif,bmp,png). Note : you can easily add extra file extensions.

Filtering

Some default FileUtils.FilterWrapper will be used :

  • interpolation with token ${ } and values from filters, project.filters, project.build.filters, pom.properties and mavenSession.executionProperties
  • interpolation with token @ @ and values from filters, project.filters, project.build.filters, pom.properties and mavenSession.executionProperties
  • interpolation with token ${ } and values from mavenProject interpolation

The values (Properties object) used for interpolation are loaded with the following order :

  • List of properties file ( the method has a parameter which accept a List of String -> path properties files )
  • pom.filters
  • pom.build.filters
  • pom.properties
  • mavenSession.executionProperties

NOTE : As it's a Properties object, last defined key/value pair wins .

NOTE : When building the global Properties object and reading the properties files defined the different filters, interpolation with the token ${ } is supported for this filters with a limited properties values coming from pom.properties and mavenSession.executionProperties (last wins too)

  • No labels