The git command as a pipeline stage is quite limited as it provides the default implementation of a more complex validation command . For a more complex configuration, you should use the checkout command, for which you can pass many parameters, including the desired configuration of the submodules.
What you want to use is probably something like this:
checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'SubmoduleOption', disableSubmodules: false, parentCredentials: false, recursiveSubmodules: true, reference: '', trackingSubmodules: false]], submoduleCfg: [], userRemoteConfigs: [[url: 'your-git-server/your-git-repository']]])
From the documentation it is often cumbersome to write such lines, I recommend that you use the Jenkins very well Snippet Generator (YourJenkins> yourProject> PipelineSyntax) to automatically generate a validation string!
Pom12
source share