11

I've added some extra ACLs to /home/groups and /home/users by adding _rep_policy.xml files for each, but can't seem to get them to deploy. I added the following lines to my vault filter.xml

<filter root="/home/users/rep:policy" mode="replace"/>
<filter root="/home/groups/rep:policy" mode="replace"/>

Both have contents like this:

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:rep="internal"
    jcr:primaryType="rep:ACL">
    <allow
        jcr:primaryType="rep:GrantACE"
        rep:principalName="everyone"
        rep:privileges="{Name}[jcr:read]"/>
</jcr:root>

But when I run maven, I can see everything around them get deployed, but not these two. If I try to install the package directly through package manager, it works only if I set Access Control Handling to "Replace". I don't know how to configure this in maven.

jiggy
  • 3,828
  • 1
  • 25
  • 40

4 Answers4

8

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

Sharath Madappa
  • 3,393
  • 1
  • 24
  • 41
  • This answer seemed so clear, yet when I tried it it had no effect at all. I setup a package in package manager with the right settings and downloaded to get the exact definitions/.content.xml I wanted. Added it to the project. I see it copied to target/vault-work and in the package zip. But the rep:policy is still not deployed and my configurations are not reflected in package manager. – jiggy Apr 20 '15 at 14:39
  • 2
    @jiggy , apologies for not mentioning the solution was not tested. Turns out all the configs get overridden. The right way is to set them in POM. Have edited my answer to include the same. – Sharath Madappa Apr 20 '15 at 17:18
  • 2
    Heads up: since the update of the plugin to version 1.0.2, this configuration should be added in the `filevault-package-maven-plugin` configuration. See [answer below](https://stackoverflow.com/a/60148069/776727) – NielsInc Feb 10 '20 at 10:20
5

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

Max Barrass
  • 2,776
  • 1
  • 19
  • 10
4

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

NielsInc
  • 426
  • 7
  • 23
0

Small addendum:

The acHandling options are documented not in the maven-plugin but in the aem and jackrabbit packages documentation

https://docs.adobe.com/docs/en/aem/6-2/administer/content/package-manager.html and https://jackrabbit.apache.org/filevault/apidocs/org/apache/jackrabbit/vault/fs/io/AccessControlHandling.html

the content-package-maven-plugin merely provides access to all package settings.

bjorns
  • 606
  • 1
  • 5
  • 8