Expand my Community achievements bar.

SOLVED

how do exclude/include content on filter.xml?

Avatar

Level 9

EDIT: I am trying to create the zip/package using mvn clean install.

 

might be best explained with an example

 

so I have the following filter.xml

 

<?xml version="1.0" encoding="UTF-8"?>
<workspaceFilter version="1.0">
    <filter root="/content/experience-fragments/myhost">
        <exclude pattern="/content/experience-fragments/myhost/components/showcase/dual"/>
        <exclude pattern="/content/experience-fragments/myhost/components/balance-history/master"/>
    </filter>
</workspaceFilter>

 

after running

 

mvn clean install

 

I get a package in ui.content/target. I opened this package using my favorite archiver app (in my case, I was using winrar). And I noticed 2 errors.

  • I can see the 2 paths I've excluded have been included.
  • I can see that root path I did not include in filter.xml have been included. The root path of the content that has been included is /content/myhost/portals.

Any ideas what I'm doing wrong?

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hello @jayv25585659 

 

The exclude/include configs are patterns. Could you possibly update the configs to regex and try?

<workspaceFilter version="1.0">
    <filter root="/content/experience-fragments/myhost">
        <exclude pattern="/content/experience-fragments/myhost/components/showcase/dual(/.*)?"/>
        <exclude pattern="/content/experience-fragments/myhost/components/balance-history/master(/.*)?"/>
    </filter>
</workspaceFilter>

I don't see any reason why a path like "/content/myhost/portals" would be included.

 

- Could you possibly delete the package from target folder?

- Assure you are updating the corresponding filter.xml

- Execute "mvn clean install" 

- Validate the newly generated package

 


Aanchal Sikka

View solution in original post

4 Replies

Avatar

Community Advisor

It should work. Please make sure you're updating ui.content filters.

Siva_Sogalapalli_0-1685089607104.png

 

Please check reference. 

https://jackrabbit.apache.org/filevault/filter.html 

Avatar

Correct answer by
Community Advisor

Hello @jayv25585659 

 

The exclude/include configs are patterns. Could you possibly update the configs to regex and try?

<workspaceFilter version="1.0">
    <filter root="/content/experience-fragments/myhost">
        <exclude pattern="/content/experience-fragments/myhost/components/showcase/dual(/.*)?"/>
        <exclude pattern="/content/experience-fragments/myhost/components/balance-history/master(/.*)?"/>
    </filter>
</workspaceFilter>

I don't see any reason why a path like "/content/myhost/portals" would be included.

 

- Could you possibly delete the package from target folder?

- Assure you are updating the corresponding filter.xml

- Execute "mvn clean install" 

- Validate the newly generated package

 


Aanchal Sikka

Avatar

Community Advisor

Check https://jackrabbit.apache.org/filevault/filter.html to exclude/include paths in filter.xml in META-INF/vault.