Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Policies and experience fragments ask for republish after every deployment

Avatar

Level 3

Hello communities,

After every deployment to dev/stage/production, when we try to publish a page the popup (screenshot below) always shows up and ask for republish those policies and experience fragments, even though we didn't make any updates to any policies or experience fragments. Any idea? Thanks.

Kamnyc_0-1706196758536.png

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

The reason is you are overriding the existing policies on each deployment. Add the following lines on the policy of your exp fragment. Your issue will be solved

<jcr:content
            cq:lastReplicated="{Date}2020-01-01T00:00:00.000+01:00"
            cq:lastReplicatedBy="Deployment"
            cq:lastReplicationAction="Activate"
            cr:primaryType="nt:unstructured"/>

Another way is set the mode to merge on filter so that its not replaced on each deployment.

<filter root="/conf/hbkworld/settings/wcm" mode="merge">
    <include pattern="/conf/{your_app_name}/settings/wcm/policies"/>
</filter

View solution in original post

5 Replies

Avatar

Community Advisor

Hi @Kam-nyc 

  1. Verify that the policies and experience fragments are being properly saved and published during the deployment process.
  2. Check if there are any caching issues that might be causing the popup to show up even though the policies and experience fragments have already been published.
  3. If the issue persists, you can try clearing the cache and restarting the server to see if that resolves the issue.


Avatar

Community Advisor

@Kam-nyc ,

Check the filter paths in ui.config and ui.content maven modules. It seems you are replacing the content in these mutable paths of policies and experience-fragments by the content saved in the code.

Avatar

Community Advisor

 

Agreed with @Sudheer_Sundalam, it seems like you are redeploying that content with each deployment. Please check if you have versioned properties with dates, such as cq:lastModified and cq:lastActivation; usually, this should be avoided.

 



Esteban Bustamante

Avatar

Correct answer by
Community Advisor

The reason is you are overriding the existing policies on each deployment. Add the following lines on the policy of your exp fragment. Your issue will be solved

<jcr:content
            cq:lastReplicated="{Date}2020-01-01T00:00:00.000+01:00"
            cq:lastReplicatedBy="Deployment"
            cq:lastReplicationAction="Activate"
            cr:primaryType="nt:unstructured"/>

Another way is set the mode to merge on filter so that its not replaced on each deployment.

<filter root="/conf/hbkworld/settings/wcm" mode="merge">
    <include pattern="/conf/{your_app_name}/settings/wcm/policies"/>
</filter

Avatar

Administrator

@Kam-nyc Did you find the suggestions from users 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