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

Konrad Windszus commented on JCRVLT-279:
----------------------------------------

After thinking some more about it I don't think the logic to add files to the 
package is correct (neither with  my PR nor without it). Just consider the 
following repo

{code}
+ /content/dam (sling:Folder)
{code} 

Now you have the following in your package
{code}
+ jcr_root/content/dam/myapp
   + /mysubfolder
     + .content.xml (containing some entries)
{code}

with filter.xml
{code}
<workspaceFilter version="1.0">
<filter root="/content/dam/myapp/mysubfolder"/>
</workspaceFilter>
{code}

The ancestor node {{/content/dam/myapp}} is not covered by the filter root, but 
would need to be created during package installation. Either the node is being 
determined by an according {{.content.xml}} below 
{{jcr_root/content/dam/myapp}} within the package or it will fall back to the 
empty node with the default node type {{nt:folder}}. In case you expect a 
certain node type at {{/content/dam/myapp}} you should rather include a 
{{.content.xml}} within your package, but the current logic in 
https://github.com/apache/jackrabbit-filevault-package-maven-plugin/blob/f165aac9c02025650d01d1ee6997448c375796fe/src/main/java/org/apache/jackrabbit/filevault/maven/packaging/VaultMojo.java#L237
 does not do that, because it stops at the first directory found from the 
filter root on.

I would rather argue, that you should always include all ancestor nodes of a 
filter root within a package (even if those are not covered by a filter rule), 
because they might be considered during installation (in case the ancestor node 
is not yet there in the repo).
[~tripod] WDYT?

> Emit warning/error in case embedded file/subpackage is overwritten by 
> jcrRootSourceDirectory
> --------------------------------------------------------------------------------------------
>
>                 Key: JCRVLT-279
>                 URL: https://issues.apache.org/jira/browse/JCRVLT-279
>             Project: Jackrabbit FileVault
>          Issue Type: Bug
>          Components: package maven plugin
>    Affects Versions: package-maven-plugin-1.0.1
>            Reporter: Konrad Windszus
>            Priority: Minor
>             Fix For: package-maven-plugin-1.0.4
>
>
> Due to errorneous project setup it may sometimes happen that the 
> {{jcrRootSourceDirectory}} inadvertently contains the to be embedded file. 
> Since the {{jcrRootSourceDirectory}} is having a higher precedence all files 
> in there overwrite previously embedded files. In that case a warning/error 
> should be emitted. The same for sub packages.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to