How to deploy rep:policy files via maven?

The package properties are configured in the configuration section of vault plugin in POM. To enable ACL import in the package add the below configurations to the POM

<configuration>
        <properties>
             <acHandling>Overwrite</acHandling>
        </properties>
</configuration>

The documentation for the vault plugin is at http://docs.adobe.com/docs/en/cq/5-6-1/core/how_to/how_to_use_the_vlttool/vlt-mavenplugin.html


so this is answered properly once and for all... update you pom build plugin "com.day.jcr.vault":

<plugin>
    <groupId>com.day.jcr.vault</groupId>
    <artifactId>content-package-maven-plugin</artifactId>
    <version>0.0.24</version>
    <extensions>true</extensions>
    <configuration>
        <failOnError>true</failOnError>
        <username>${crx.username}</username>
        <password>${crx.password}</password>
        <properties>
            <acHandling>merge_preserve</acHandling>
        </properties>
    </configuration>
</plugin>

acHandling options: - ignore - overwrite - merge - merge_preserve - clear


Since the 1.0.2 version update of Adobe's content-package-maven-plugin, all content packaging functionality was removed and added to the org.apache.jackrabbit filevault-package-maven-plugin

The acHandling configuration will no longer work in the content-package-maven-plugin and instead needs to be added to the filevault-package-maven-plugin

<plugin>
    <groupId>org.apache.jackrabbit</groupId>
    <artifactId>filevault-package-maven-plugin</artifactId>
    <version>1.0.3</version>
    <extensions>true</extensions>
    <configuration>
        <embeddeds>
            <embedded>
                <groupId>com.company</groupId>
                <artifactId>company.core</artifactId>
                <target>/apps/company/install</target>
            </embedded>
        </embeddeds>

        <!-- NEW LOCATION -->
        <properties>
            <acHandling>merge_preserve</acHandling>
        </properties>
        <!-- /NEW LOCATION -->

    </configuration>
</plugin>
<plugin>
    <groupId>com.day.jcr.vault</groupId>
    <artifactId>content-package-maven-plugin</artifactId>
    <version>1.0.2</version>
    <extensions>true</extensions>
    <configuration>
        <verbose>true</verbose>
        <failOnError>true</failOnError>
        <group>company.aem</group>
    </configuration>
</plugin>

For a full migration guide, visit the Jackrabbit documentation

Tags:

Maven

Aem