Mihi Mihi - 1 year ago 147
Git Question

How to get Maven release to clone git submodules?

I've got a Maven project with some git submodules linked. Everything works fine until I do a release:prepare or :perform, the clean checkout these targets perform does not contain the submodules (or in other words, git clone is not recursive).
I could not find a proper way to configure Maven to call git clone with the --recursive option.

I was thinking of using the scm provider configuration (http://maven.apache.org/scm/git.html) or simply to configure the release plugin directly in the pom.xml, but couldn't get it to work.


Answer Source

I just added the following plugin:

<!-- This is a workaround to get submodules working with the maven release plugin -->
            <id>invoke build</id>

And my update.sh contains:

git submodule update --init
git submodule foreach git submodule update --init