how do exclude/include content on filter.xml? | Community
Skip to main content
jayv25585659
Level 8
May 26, 2023
Solved

how do exclude/include content on filter.xml?

  • May 26, 2023
  • 3 replies
  • 4014 views

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?

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by aanchal-sikka

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

 

3 replies

Siva_Sogalapalli
Community Advisor
Community Advisor
May 26, 2023

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

 

Please check reference. 

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

jayv25585659
Level 8
May 26, 2023

definitely updating/editing ui.content filter.xml.

aanchal-sikka
Community Advisor
aanchal-sikkaCommunity AdvisorAccepted solution
Community Advisor
May 26, 2023

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
rawvarun
Community Advisor
Community Advisor
May 30, 2023

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