Filtering
Overview
The package
goal supports filtering (i.e. placeholder replacement) similar to the maven-resources-plugin in arbitrary package source files.
As filtering may destroy binary files you should make sure that filtering is only applied to textual files.
Configuration
You need to set plugin parameter enableJcrRootFiltering
and/or enableMetaInfFiltering
to true
to enable filtering at all.
There are several other parameters which allow to further tweak the filtering behavior.
An example configuration which enables filtering on all .content.xml
files in the jcr root source folder looks like this:
<plugin>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>filevault-package-maven-plugin</artifactId>
<version>1.3.5-SNAPSHOT</version>
<executions>
<execution>
<!-- default execution id for primary artifact: https://maven.apache.org/guides/mini/guide-default-execution-ids.html#default-executionids-for-implied-executions -->
<id>default-package</id>
<configuration>
<enableJcrRootFiltering>true</enableJcrRootFiltering><!--only enable filtering on jcr root source files-->
<filterFiles>
<!-- additional properties file specifying keys and values -->
<filterFile>filter.properties</filterFile>
</filterFiles>
<!-- only enable filtering on .content xml files -->
<filteredFilePatterns>
<filteredFilePattern>**/.content.xml</filteredFilePattern>
</filteredFilePatterns>
</configuration>
</execution>
</executions>
</plugin>