Well, because by default, Adobe Cloud Manager doesn’t automatically initialize or update submodules during build. That means, Out of the box, Cloud Manager doesn’t run git submodule update --init, so submodules won’t be pulled unless you handle it manually.
You can add a custom build hook script in your project repo to manually initialize and update submodules as part of the build process.
Here’s how:
-
In your project, create a file at .cloudmanager/hooks/pre-build.sh
-
Make sure it has the following content
#!/bin/sh
echo "Initializing Git submodules..."
git submodule init
git submodule update
- Make the file executable:
chmod +x .cloudmanager/hooks/pre-build.sh
This script runs during the Cloud Manager pipeline execution (before the Maven build starts) and ensures submodules are pulled properly.
Make Sure .gitmodules and Submodule Commits Are Up to Date
-
Double-check that your .gitmodules file is committed
-
Ensure the submodule pointers are not pointing to local-only commits
-
Use HTTPS URLs for submodules if Cloud Manager needs to access private repos (and ensure credentials or access tokens are handled accordingly)
Below is one of my articles where I’ve provided a sample script along with a reference to Adobe’s official documentation:
https://techinnovia.com/syncing-customer-managed-azure-devops-repo-with-adobe-cloud-manager-repo/
https://experienceleague.adobe.com/en/docs/experience-manager-cloud-service/content/implementing/using-cloud-manager/managing-code/git-submodules
Hope that helps!