Filter.xml ValidationViolation: "jackrabbit-filter: | Community
Skip to main content
Community Advisor
September 18, 2023
Solved

Filter.xml ValidationViolation: "jackrabbit-filter:

  • September 18, 2023
  • 4 replies
  • 3722 views

Hi All,

I am trying to add a filter for my tags. This is my tag structure. In the below I don't want my tag1 to get included as part of build whereas I want my tag2 to be part of package.

 

 /content/cq:tags

                          tag1

                          tag2

 

Now below is the filter.xml of content node

<filter root="/content/cq:tags">
<exclude pattern="/content/cq:tags/tag1(.*)?"/>
</filter>
 
I am getting below error when I build
 

[ERROR] ValidationViolation: "jackrabbit-filter: Node '/content/cq:tags/tag1' is not contained in any of the filter rules", filePath=jcr_root/content/_cq_tags/tag1/.content.xml

 

If I modify the filter.xml as shown below then the error gets resolved but my problem is I just want to exclude tag1 from build whereas I want all rest of tags to be included as part of feature development.

<filter root="/content/cq:tags/tag1">
<exclude pattern="/content/cq:tags/tag1(.*)?"/>
</filter>

 

Please suggest.

 

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 A_H_M_Imrul

Hello @ganthira1,

 

I believe you are using the updated AEM archetype, there (pom.xml under ui.apps.structure module) you have the option to put the list of valid roots (JCR Paths) that you want to work on as following:

 

 

 

<build> <plugins> <plugin> <groupId>org.apache.jackrabbit</groupId> <artifactId>maven-jackrabbit-filevault-plugin</artifactId> <version><!-- Specify the version --></version> <configuration> <properties> <cloudManagerTarget>none</cloudManagerTarget> </properties> <filters> <filter><root>/apps/${project-name}</root></filter> <filter><root>/content/cq:tags/tag1</root></filter> <filter><root>....</root></filter> </filters> </configuration> </plugin> </plugins> </build>

 

 

   please consider additing the root in the list above, that you want to include from filter.xml..

4 replies

A_H_M_Imrul
Community Advisor
A_H_M_ImrulCommunity AdvisorAccepted solution
Community Advisor
September 18, 2023

Hello @ganthira1,

 

I believe you are using the updated AEM archetype, there (pom.xml under ui.apps.structure module) you have the option to put the list of valid roots (JCR Paths) that you want to work on as following:

 

 

 

<build> <plugins> <plugin> <groupId>org.apache.jackrabbit</groupId> <artifactId>maven-jackrabbit-filevault-plugin</artifactId> <version><!-- Specify the version --></version> <configuration> <properties> <cloudManagerTarget>none</cloudManagerTarget> </properties> <filters> <filter><root>/apps/${project-name}</root></filter> <filter><root>/content/cq:tags/tag1</root></filter> <filter><root>....</root></filter> </filters> </configuration> </plugin> </plugins> </build>

 

 

   please consider additing the root in the list above, that you want to include from filter.xml..

kautuk_sahni
Community Manager
Community Manager
September 18, 2023

@ganthira1 Did you find the suggestion from @a_h_m_imrul 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
aanchal-sikka
Community Advisor
Community Advisor
September 18, 2023

Hello @ganthira1 

 

"jackrabbit-filter: Node '/content/cq:tags/tag1' is not contained in any of the filter rules"

  • Through this message, the validator aims to verify that we are not creating/manipulating a sub-tree (tag1) in AEM/codebase without having the parent node present.

 

We just need to affirm via ui.apps.structure module, that the node is present in CRX. Thus, validator can skip this check.

  • Go to ui.apps.structure module
  • Open its pom.xml
  • Add following code
<filter><root>/content/cq:tags/tag1</root></filter>

 In your base, you are trying to exclude (which can be confusing), but validator is checking for all configured paths.

 

Please append the config and check, if it resolves the issue.

Aanchal Sikka
October 15, 2023

did this solution work for you? what was file vault plugin version you have used, I am on the same boat any info will be very useful. @ganthira1 

 

Thanks