Checkout multiple git repos into same Jenkins workspace

With the Multiple SCMs Plugin:

  • create a different repository entry for each repository you need to checkout (main project or dependancy project.

  • for each project, in the “advanced” menu (the second “advanced” menu, there are two buttons labeled “advanced” for each repository), find the “Local subdirectory for repo (optional)” textfield. You can specify there the subdirectory in the “workspace” directory where you want to copy the project to. You could map the filesystem of my development computer.

The “second advanced menu” doesn’t exist anymore, instead what needs to be done is use the “Add” button (on the “Additional Behaviours” section), and choose “Check out to a sub-directory”

  • if you are using ant, as now the build.xml file with the build targets in not in the root directory of the workspace but in a subdirectory, you have to reflect that in the “Invoke Ant” configuration. To do that, in “Invoke ant”, press “Advanced” and fill the “Build file” input text, including the name of the subdirectory where the build.xml is located.

Hope that helps.

Leave a Comment