Build is failing due to CHECKSUM issue.

 Maven build is failing due to CHECKSUM issue. 


AEM Developers, Infrastructure Engineers regularly come across a challenge on building the AEM code & dispatcher module use to get failed while mvn build. The article addresses in a simple way on how to understand the mechanisms of dispatcher module build, and gives a detailed explanation of how it can be resolved. 



This is useful for  building the code for a deployment via Pipeline either it is Adobe Cloud manager or Jenkins, you can see this error while your local build itself. 

This error is caused, as the dispatcher owner does not not want you to change/modify few of its default files which are marked as immutable in dispatcher server. 

You can find full list of immutable files on of dispatcher provided by Adobe. 



Issue :- In AEM while doing the deployment it is being seen , user get the exception , Maven mandatory check failed. 

[main] [ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:3.0.0-M3:enforce (enforce-checksum-of-immutable-files) on project XXXXXXXX  Some Enforcer rules have failed.



Solution :- To make sure you do not modify the default files the maven dispatcher module forces the file checksum verification method. 

All these checksum values can be find in the. 

        <<directory root>>/dispatcher/pom.xml

SAMPLE POM FILE 

<requireFileChecksum>

  <file>src/conf.d/available_vhosts/aem_author.vhost</file>

<checksum>xxxxxxxxxxxxxxxxxxxxxxx</checksum>

<type>md5</type>

  <message>There have been changes detected in a file which is supposed to be immutable.

</requireFileChecksum>

<requireFileChecksum>

  <file>src/conf.d/available_vhosts/aem_publish.vhost</file>

<checksum>xxxxxxxxxxxxxxxxxxxxxxx</checksum>

<type>md5</type>

  <message>There have been changes detected in a file which is supposed to be immutable

</requireFileChecksum>



To get the issue resolved you have 2 options. 

Option 1 - you should make sure the chcksum value present in pom.xml is same as the corresponding file.  - Correct and recommended way 

Option 2- You can simply comment the lines in pom.xml for the files which you do not want to be verified. 


Hope this helps you to to find the solution of the problem. 


Comments

  1. The Option 1 which says the checksum value present in pom.xml should match the corresponding file. I was not able to find the checksum value in the file.

    The checksum value for src/conf.d/available_vhosts/default.vhost is fbe1225838269b6481db31868868da91 but I was not able to see this checksum value in the file at that path.
    How do we verify the Option 1 then ?

    ReplyDelete

Post a Comment

Popular Posts

How to Increase Apache Request Per Second ?

how to clear dispatcher cache in aem ?

Configure/Decoding AEM AuditLogs

How to Configure CSP header in AEM , Dispatcher ?

How to prevent DDoS in Apache ?

How to protect AEM against CSRF Attack ?

Difference between Adobe AEM Enterprise vs Adobe AEM as a Cloud Service

Security best Practice in AEM

How Does S3 works with AEM ?

AdobeDispatcherHacks ".statfile"