AEM 6.4 filter.xml | exclude pattern not working

Avatar

Avatar
Validate 1
Level 1
pradeepd1320668
Level 1

Likes

2 likes

Total Posts

30 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Ignite 1
Give Back
Boost 1
View profile

Avatar
Validate 1
Level 1
pradeepd1320668
Level 1

Likes

2 likes

Total Posts

30 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Ignite 1
Give Back
Boost 1
View profile
pradeepd1320668
Level 1

19-01-2021

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

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Boost 250
MVP
ChitraMadan
MVP

Likes

272 likes

Total Posts

165 posts

Correct reply

67 solutions
Top badges earned
Boost 250
Establish
Ignite 1
Give Back 5
Give Back 3
View profile

Avatar
Boost 250
MVP
ChitraMadan
MVP

Likes

272 likes

Total Posts

165 posts

Correct reply

67 solutions
Top badges earned
Boost 250
Establish
Ignite 1
Give Back 5
Give Back 3
View profile
ChitraMadan
MVP

19-01-2021

Hi @pradeepd1320668,

 

Can you please try with this:

 

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

Answers (3)

Answers (3)

Avatar

Avatar
Boost 5
Level 2
Yonit
Level 2

Likes

8 likes

Total Posts

19 posts

Correct reply

1 solution
Top badges earned
Boost 5
Give Back 5
Give Back 3
Give Back
Boost 3
View profile

Avatar
Boost 5
Level 2
Yonit
Level 2

Likes

8 likes

Total Posts

19 posts

Correct reply

1 solution
Top badges earned
Boost 5
Give Back 5
Give Back 3
Give Back
Boost 3
View profile
Yonit
Level 2

20-01-2021

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.

Avatar

Avatar
Boost 500
MVP
Vijayalakshmi_S
MVP

Likes

572 likes

Total Posts

716 posts

Correct reply

238 solutions
Top badges earned
Boost 500
Give Back 50
Give Back 5
Ignite 10
Ignite 5
View profile

Avatar
Boost 500
MVP
Vijayalakshmi_S
MVP

Likes

572 likes

Total Posts

716 posts

Correct reply

238 solutions
Top badges earned
Boost 500
Give Back 50
Give Back 5
Ignite 10
Ignite 5
View profile
Vijayalakshmi_S
MVP

19-01-2021

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.

Avatar

Avatar
Validate 25
MVP
PuzanovsP
MVP

Likes

140 likes

Total Posts

543 posts

Correct reply

165 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Contributor 2
Ignite 10
View profile

Avatar
Validate 25
MVP
PuzanovsP
MVP

Likes

140 likes

Total Posts

543 posts

Correct reply

165 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Contributor 2
Ignite 10
View profile
PuzanovsP
MVP

19-01-2021

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