问题
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.
回答1:
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
回答2:
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
回答3:
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.
来源:https://stackoverflow.com/questions/29710649/how-to-deploy-reppolicy-files-via-maven