Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

AEM 6.4 filter.xml | exclude pattern not working

pradeepd1320668
Level 2
Level 2

Hi All,

Exclude pattern is not working in my local. Every time I deploy it overwrite the changes in OSGI console.

Sharing below filter.xml.

workspaceFilter version="1.0">
<filter root="/apps/test">
<include pattern="/apps/test(/.*)?" />
<exclude pattern="/apps/test/config/my.test.config.TestConfiguration" />
</filter>

</workspaceFilter>

 

Can someone advise if I am missing anything.

 

Thanks,

Pradeep

1 Accepted Solution
ChitraMadan
Correct answer by
Community Advisor
Community Advisor

Hi @pradeepd1320668,

 

Can you please try with this:

 

<filter root="/apps/test">
<exclude pattern="/apps/test/config/my.test.config.*" />
</filter>

View solution in original post

8 Replies
PuzanovsP
Community Advisor
Community Advisor

Hi Pradeep,

 

Doesn't your TestConfiguration end with .xml, so that exclude rule would be :

<exclude pattern="/apps/test/config/my.test.config.TestConfiguration.xml" />

Regards,

Peter 

Vijayalakshmi_S
Community Advisor
Community Advisor

Hi @pradeepd1320668,

Can you try with exclude alone because with root value as "/apps/test", all nodes of test would be included anyway. No need to have explicit include tag.

<filter root="/apps/test">
<exclude pattern="/apps/test/config/my.test.config.TestConfiguration" />
</filter>

If it is still not working, try to frame the pattern in the form of regex considering rest of the nodes part of config folder.

pradeepd1320668
Level 2
Level 2
I will try and let you know. The issue is in QA and UAT it is working where we have one publisher. PPE and prod it is failing where we have 4 publishers.
ChitraMadan
Correct answer by
Community Advisor
Community Advisor

Hi @pradeepd1320668,

 

Can you please try with this:

 

<filter root="/apps/test">
<exclude pattern="/apps/test/config/my.test.config.*" />
</filter>

View solution in original post

Yonit
Level 2
Level 2

Since you intend the osgi changes to persist, instead of trying to exclude it, make the config part of your code base.  Add the file under my.test.config.TestConfiguration.xml under /apps/test/config with the configuration values you want to persist:

 

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:primaryType="sling:OsgiConfig"
myproperty.myvalue="Hello" />

 

If you already have this file and specifically are having a problem locally because the values aren't good for local, you can either modify the values to the ones you want to persist for local or you can have config per runmode, or use build variables for the values which would be different per environment.

kautuk_sahni
Community Manager
Community Manager
@Yonit, thank you for sharing the information with community. Keep assisting the AEM Community.
pradeepd1320668
Level 2
Level 2
Hello All, I have 4 publishers. Configuration value will be same in all 4 publishers. Since SAML IDP certificate alias is different for each publisher so it will not work. Once I configured these value next time I though to exclude so that it will not overwrite. Unfortunately it is not working.
Yonit
Level 2
Level 2
@pradeep1320668 What are you saying will not work?