Maven Build Error when including dispatcher module | Community
Skip to main content
Rohan_Garg
Community Advisor
Community Advisor
June 24, 2022

Maven Build Error when including dispatcher module

  • June 24, 2022
  • 2 replies
  • 3792 views

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 -

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

Himanshu_Jain
Community Advisor
Community Advisor
June 24, 2022

Try to add 

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

 

Thanks

Himanshu Jain
Rohan_Garg
Community Advisor
Community Advisor
June 24, 2022

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.

SantoshSai
Community Advisor
Community Advisor
June 25, 2022

Hi @rohan_garg ,

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

Santosh Sai
Rohan_Garg
Community Advisor
Community Advisor
June 27, 2022

Hi Santosh,

 

Thanks for the reply.

Yes, I am using windows machine and have been referring to the same articles.

We tried to deploy the same pom/xml on a mac machine which is Unix based but got the same error.

 

On a side note, if we replaced the default files again and overlay them with our custom configuration then the enforcer issue should not be there on windows machine too right ?

Currently we haven't changed any of the default configurations but still the error is coming on both mac and windows machine. The display-info goal works but might not be feasible on a production deployment. 

 

Thanks,

Rohan Garg

 

 

 

 

 

New Member
September 26, 2022

Hi Rohan,

I am facing the same issue as mentioned in this thread.

Were you able to find any resolution for it?

Thanks,
Gautam