filter.xml ValidationViolation error. | Community
Skip to main content
Level 2
October 13, 2023

filter.xml ValidationViolation error.

  • October 13, 2023
  • 3 replies
  • 1486 views

Dear community,

 

I have the requirement to exclude components under one folder from the built package.

 

I made the following changes to filter.xml

 

<filter root="/apps/myapp/components">

        <exclude pattern="/apps/myapp/components/macrsite(/.*)?" />

</filter>

 

the ui.apps.structure pom looks like this for app root

<!-- /apps root -->

<filter><root>/apps</root>/filter>

<filter><root>/apps/myapp</root>/filter>

<filter><root>/apps/myapp/components/macrsite/filter>

 

added below configuration in filevault-package-maven-plugin

 

<jackrabbit-packagetype>

   <options>

         <allowComplexFilterRulesInApplicationPackages>true</allowComplexFilterRulesInApplicationPackages>

    </options>

</jackrabbit-packagetype>

 

I am still receiving errors like 

ValidationViolation: "jackrabbit-filter: Node '/apps/myapp/components/macrsite/page' is not contained in any of the filter rules", filePath=jcr_root\apps\myapp\components\macrsite\page\.content.xml

ValidationViolation: "jackrabbit-filter: Node '/apps/myapp/components/macrsite/page/head.html' is not contained in any of the filter rules", filePath=jcr_root\apps\myapp\components\macrsite\page\head.html

.

.

etc

 

Literally the above violation error happens for everything under folder macrsite, I am using filevault-package-maven-plugin of version 1.1.6 and the AEM version in 6.5.18

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

3 replies

aanchal-sikka
Community Advisor
Community Advisor
October 13, 2023

Hello @seeker 

 

Please refer to https://sourcedcode.com/blog/aem/jackrabbit-filter-filter-roots-ancestor-etc-mobile-groups

Please check, if configuring "validRoots" helps !

 

 

Aanchal Sikka
seekerAuthor
Level 2
October 13, 2023

unfortunately, it is not working. I am still getting the same error.

aanchal-sikka
Community Advisor
Community Advisor
October 13, 2023

Hello @seeker 

 

Requesting you to plesae share the values that you have tried for validRoots.

 

Meanwhile, please add following in pom.xml of ui.apps.structure package

 

<filter><root>/apps/myapp/components/macrsite/page</root></filter>

Aanchal Sikka
kautuk_sahni
Community Manager
Community Manager
October 13, 2023

@seeker  Did you find the suggestions from Aanchal helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.

Kautuk Sahni
seekerAuthor
Level 2
October 15, 2023

The validation errors are gone when I added filter root in the plugin configuration of apps module, but no luck the build is success, however package contains excluded component.

<filters>

   <filter>

     <root>/apps/myapp/components/macrsite </root>

  </filter>

</filters>