This plugin reads Jade files and creates filter.xml file for content package.
To read more about the Jackrabbit Vault filters see:
- Adobe AEM documentation about package filters
- Stackoverflow explanation of how filters work
- Documentation for plugin that generates Vault packages
It removes code duplication if you are using same filters in different Maven modules.
You may have separate Maven modules for your sample content, assets and application. During development process it is convenient to only build ZIP package that contains application code. The assets and sample content packages need to be built only when they change.
However when making a release you usually want to have one single package with all parts. The filters for this package need to be in sync with the filters for submodules. This is where you can benefit from Jade to Filters Maven Plugin.
Add Jade file src/main/resources/filter.jade
with filters definition
filter(root="/content/project")
exclude(pattern="/content/project(/.*)?/qa(/.*)?")
filter(root="/content/project/dam")
exclude(pattern="/content/project/dam(/.*)?/renditions(/.*)?")
include(pattern="/content/project/dam(/.*)?/renditions/original")
exclude(pattern="/content/project/dam(/.*)?/qa(/.*)?")
Add plugin in your pom.xml:
<build>
<plugin>
<groupId>pl.kubiczak</groupId>
<artifactId>jade-to-filters-maven-plugin</artifactId>
<version>1.0.0-RC2</version>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<inputFiles>
<file>${project.basedir}/src/main/resources/filter.jade</file>
</inputFiles>
<outputFile>${project.basedir}/src/main/resources/META-INF/vault/filter.xml</outputFile>
</configuration>
</execution>
</executions>
</plugin>
</build>
You could use more Jade files. They will be all converted into filters:
<configuration>
<inputFiles>
<file>${project.basedir}/src/main/resources/filter-content.jade</file>
<file>${project.basedir}/src/main/resources/filter-dam.jade</file>
</inputFiles>
</configuration>
You could add comments in Jade files i.e.:
filter(root="/content/project")
// let's exclude qa content from package
exclude(pattern="/content/project(/.*)?/qa(/.*)?")
Maven release plugin is used for making a release for this project.
Please execute:
mvn release:prepare -B -DreleaseVersion=1.0.0 -DdevelopmentVersion=1.0.1-SNAPSHOT
mvn release:perform -Psources,javadoc,sign