Policies and experience fragments ask for republish after every deployment | Community
Skip to main content
New Participant
January 25, 2024
Solved

Policies and experience fragments ask for republish after every deployment

  • January 25, 2024
  • 5 replies
  • 825 views

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.

 

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 kaikubad

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

5 replies

kautuk_sahni
Employee
January 30, 2024

@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
kaikubad
kaikubadAccepted solution
New Participant
January 26, 2024

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
EstebanBustamante
New Participant
January 25, 2024

 

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
Sudheer_Sundalam
New Participant
January 25, 2024

@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.

Raja_Reddy
New Participant
January 25, 2024

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.