AEM - vault -package filter.xml query

pn_2007

28-07-2020

In my apps package filter.xml i have give as below:

<filter root="/apps/site">
    <include pattern="/apps/site/components"/>
    <include pattern="/apps/site/config"/>
    <include pattern="/apps/site/config(.*)?"/>
    <include pattern="/apps/site/install"/>
    <include pattern="/apps/site/pages"/>
    <include pattern="/apps/site/templates"/>    
</filter>

With the above code, when I am deploying my package, any new folders/files created are getting updated in crxde any existing html file changes are getting updated in crxde but changes to component dialog.xml are not getting updated in crxde (to explain, I make changes directly in one of the component dialog in crxde and then i deploy my package. The changes I did are not getting udpated from my codebase is the problem)

So then I add the below pattern as well to the filter.xml and it works.

<include pattern="/apps/site/components(/.*)"/>

Can someone help me if we need to include both the below patterns in filter if this need to work or do we have an alternative approach?

<include pattern="/apps/site/components"/>
<include pattern="/apps/site/components(/.*)"/>
AEM filter maven package

Accepted Solutions (1)

Accepted Solutions (1)

BrianKasingli

MVP

28-07-2020

@pn_2007 

Your filtering.xml file looks correct. What is your project's version? If there is no SNAPSHOT, then you need to manually click on install from the package manager, every time the package is uploaded into AEM. During development, we are expected to work against a SNAPSHOT version.

Secondly, if the SNAPSHOT version is not the problem, can you manually install the package in the package manager? I have a strong feeling that it might be the SNAPSHOT version not exist, as you may need to install the package manually, by clicking on the install button from the package manager. 

filter.xml below will replace all crx/de nodes with the folder structure provided below, recursively. You're on the right track.

 

 

<?xml version="1.0" encoding="UTF-8"?>
<workspaceFilter version="1.0">
    <filter root="/apps/my-site"/> // if empty, the mode is "replace"
</workspaceFilter>

 

 

Also, a reminder of the filter modes:

  1. replace : This is the normal behavior. Existing content is replaced completely by the imported content, i.e. is overridden or deleted accordingly.
  2. merge : Existing content is not modified, i.e. only new content is added and none is deleted or modified.
  3. update : Existing content is updated, new content is added and none is deleted.

Answers (3)

Answers (3)

fanindras

28-07-2020

@pn_2007 ,

 

As per my understanding, you have a solution to get the component dialog content updated but the actual problem is the necessity to always add multiple <include> entry for components like below:

 

<include pattern="/apps/site/components"/>
<include pattern="/apps/site/components(/.*)"/>

To avoid this, you can use a more generic regex like <include pattern="/apps/site/components(/.*)?"/> . I couldn't test this in my local though, Please verify and confirm, if this helps.

 

Alternatively, you can explore using <exclude> patterns for excluding specific folders that you don't want to deploy, rather than having <include> patterns for each sub folder of /apps/site, something like below:

<filter root="/apps/site">
    <exclude pattern="/apps/site/dont-include(/.*)"/> 
</filter>

 

Albin_Issac

MVP

28-07-2020

<include pattern="/apps/site/components"/> - the pattern which has the format of a regexp. The regexp is matched against the full path of the respective or potential JCR node, so it either must start with / (absolute regex) or a wildcard (relative regex). If the pattern is absolute path only the specific domain is matched.

Refer http://jackrabbit.apache.org/filevault/filter.html for more details.

My recommendation is to use <filter root="/apps/site"/> without any includes so that all child nodes will be included if require define excludes based on the regex pattern.

Regards

Albin I

www.albinsblog.com

Shashi_Mulugu

MVP

28-07-2020

@pn_2007 what version of aem you are using and what is the content maven plugin version also, why are using include pattern? Instead of just root? Any specific reason?