[ 
https://issues.apache.org/jira/browse/JCRVLT-415?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17045352#comment-17045352
 ] 

Csaba Varga commented on JCRVLT-415:
------------------------------------

[~kwin]: I think you've attached the wrong file. test2.zip has the exact same 
content as test.zip.

Based on what you've described, I agree that the validator is right and the 
export is wrong. I've originally noticed this issue while migrating our code 
base from using the old Adobe packaging plugin to the latest Apache one, so I'm 
mainly interested in ensuring that the package we're building is healthy and 
creates exactly the nodes we want.

If having just the empty folders is not the way to go, how should we fix our 
source code? Keeping the original test.zip as an example, is the right way to 
fix this to add the whole subtree to /jcr_root/test/.content.xml like this?

{{<?xml version="1.0" encoding="UTF-8"?>}}
{{<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0"; 
xmlns:nt="http://www.jcp.org/jcr/nt/1.0"}}
 {{ jcr:primaryType="nt:unstructured">}}
{{  <foo jcr:primaryType="nt:folder">}}
 {{    <bar jcr:primaryType="nt:folder">}}
 {{      <baz/>}}
 {{    </bar>}}
 {{  </foo>}}
{{</jcr:root>}}

Or should we add a .content.xml like this to the "foo" and "bar" subfolders?

{{<?xml version="1.0" encoding="UTF-8"?>}}
{{<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0"; 
xmlns:nt="http://www.jcp.org/jcr/nt/1.0"}}
 {{ jcr:primaryType="nt:folder"/>}}

The latter would be slightly easier to maintain in the long term, but I'm 
worried that Filevault would interpret the empty XML element as an instruction 
to delete all child nodes.

> jackrabbit-emptyelements validator reports error for nested folders
> -------------------------------------------------------------------
>
>                 Key: JCRVLT-415
>                 URL: https://issues.apache.org/jira/browse/JCRVLT-415
>             Project: Jackrabbit FileVault
>          Issue Type: Bug
>          Components: vlt
>    Affects Versions: 3.4.2
>            Reporter: Csaba Varga
>            Priority: Minor
>         Attachments: test.zip, test2.zip
>
>
> When an nt:folder node is present under an orderable node, the 
> "jackrabbit-emptyelements" validator will report an issue (breaking the build 
> with the default settings of the package Maven plugin). I believe this 
> shouldn't be reported as an issue because the AEM Package Manager can 
> generate packages like this. For example, see the attached test.zip file, 
> which was exported on an out-of-the-box AEM 6.5 instance with dummy nodes.
> To reproduce, save test.zip somewhere, then invoke the validation Maven goal 
> in the command like like this:
> {{mvn org.apache.jackrabbit:filevault-package-maven-plugin:validate-package 
> -Dvault.packageToValidate=test.zip}}
> test.zip contains the following very simple node hierarchy:
> {{/}}
>  {{  test (nt:unstructured)}}
>  {{    foo (nt:folder)}}
>  {{      bar (nt:folder)}}
>  {{        baz (sling:OrderedFolder)}}
> The error I'm getting is:
> {{[ERROR] ValidationViolation: "jackrabbit-emptyelements: Found empty nodes: 
> '/test/foo' (in 'test\.content.xml') (used for ordering only) which are 
> included in the filter with mode=merge. Rather use the according 
> include/exclude patterns."}}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to