Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Maven Build Error when including dispatcher module

Avatar

Level 1

Hi All,

 

I am getting the below maven build error when including the dispatcher module in my project pom for local build.

 

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:3.0.0-M3:enforce (enforce-checksum-of-immutable-files) on project xyz.dispatcher.cloud: Unable to parse configuration of mojo org.apache.maven.plugins:maven-enforcer-plugin:3.0.0-M3:enforce for parameter requireTextFileChecksum: Cannot create instance of interface org.apache.maven.enforcer.rule.api.EnforcerRule: org.apache.maven.enforcer.rule.api.EnforcerRule.<init>() -> [Help 1]

 

I was able to get a workaround for the local build by making the below change in dispatcher module's pom.xml

<goal>enforce</goal> CHANGED TO <goal>display-info</goal>

However, I will need to have the goal set to enforce when deploying this to other environments.

The default files for vhosts, rewrites, farms etc have not been modified in any ways.

 

The pom.xml for dispatcher for the specific goal is stated below -

Maven_Dispatcher_POM.png

3 Replies

Avatar

Community Advisor

Try to add 

<goals>
<goal>single</goal>
</goals>

 

Thanks

Avatar

Level 1

Hi Himanshu,

 

The build still failed with the below error - 

[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 07:01 min
[INFO] Finished at: 2022-06-24T16:44:24+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Could not find goal 'single' in plugin org.apache.maven.plugins:maven-enforcer-plugin:3.0.0-M3 among available goals display-info, enforce, help -> [Help 1]

 

There are apparently only 2 goals for the enforcer plugin.

Avatar

Community Advisor

Hi @rohangargTA ,

Are you using Windows? According to this thread: https://github.com/adobe/aem-guides-wknd/pull/202 It was the discussion about fixing issue on Windows. Apparently, when you want to build this on different environment(I believe those are Unix/Linux based) - in that case <goal>enforce</goal>  should work, since PR skips enforce for windows users.

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. 

 

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

 

Worth visiting this article: https://www.aemrules.com/2021/06/deployment-pipe-line-is-failing-due-to.html


Regards,

Santosh