Creating groups programatically
I have tried creating new groups through programatically. Created folders and required files and filter.xml using java API. Developed a maven script which uses vault plugin to create the package using the folders and filter.xml created above. When i try to build the package getting below error[ERROR] Request failed: com.day.jcr.vault.packaging.PackageException: org.apache.jackrabbit.vault.packaging.PackageException: javax.jcr.nodetype.ConstraintViolationException: OakConstraint0021: Invalid jcr:uuid for authorizable "test" (500).
jcr:uuid is generated as UUID.randomUUID().toString()
Below is the sample .content.xml of group which is created by java API:
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:rep="internal"
jcr:mixinTypes="[rep:AccessControllable]"
jcr:primaryType="rep:Group"
jcr:uuid="b0837b67-f66b-4c27-b3fe-bb298c327974"
rep:authorizableId="test"
rep:principalName="test">
<preferences
jcr:primaryType="nt:unstructured"
sling:resourceType="cq:Preferences"/>
<profile
jcr:primaryType="nt:unstructured"
sling:resourceType="cq/security/components/profile"
givenName="test"/></jcr:root>