With the above code, when I am deploying my package, any new folders/files created are getting updated in crxde any existing html file changes are getting updated in crxde but changes to component dialog.xml are not getting updated in crxde (to explain, I make changes directly in one of the component dialog in crxde and then i deploy my package. The changes I did are not getting udpated from my codebase is the problem)
So then I add the below pattern as well to the filter.xml and it works.
Can someone help me if we need to include both the below patterns in filter if this need to work or do we have an alternative approach?
Your filtering.xml file looks correct. What is your project's version? If there is no SNAPSHOT, then you need to manually click on install from the package manager, every time the package is uploaded into AEM. During development, we are expected to work against a SNAPSHOT version.
Secondly, if the SNAPSHOT version is not the problem, can you manually install the package in the package manager? I have a strong feeling that it might be the SNAPSHOT version not exist, as you may need to install the package manually, by clicking on the install button from the package manager.
filter.xml below will replace all crx/de nodes with the folder structure provided below, recursively. You're on the right track.
<?xml version="1.0" encoding="UTF-8"?>
<filter root="/apps/my-site"/> // if empty, the mode is "replace"
Also, a reminder of the filter modes:
replace: This is the normal behavior. Existing content is replaced completely by the imported content, i.e. is overridden or deleted accordingly.
merge: Existing content is not modified, i.e. only new content is added and none is deleted or modified.
update: Existing content is updated, new content is added and none is deleted.
To avoid this, you can use a more generic regex like <includepattern="/apps/site/components(/.*)?"/> . I couldn't test this in my local though, Please verify and confirm, if this helps.
Alternatively, you can explore using <exclude> patterns for excluding specific folders that you don't want to deploy, rather than having <include> patterns for each sub folder of /apps/site, something like below:
<include pattern="/apps/site/components"/> - the pattern which has the format of a regexp. The regexp is matched against the full path of the respective or potential JCR node, so it either must start with / (absolute regex) or a wildcard (relative regex). If the pattern is absolute path only the specific domain is matched.