[SCM-928] added scm type 'mount-repos' to support google repo tool for checkout manifest.xml #92
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
see jira https://issues.apache.org/jira/browse/SCM-928
as stated in https://maven.apache.org/scm.html
Checkouting maven sources can be done using google repo tool: download the file default.xml (called manifest in google repo tool), then doing "repo init"
Unfortunatly, it does not work on some windows ... It requires to install python 2.7 but not 3, and mingw but not cygwin, it calls system process for ssh.exe but fails, and does not detect the correct pathes in cygwin, etc...
This PR contains a pure java implementation of the checkout command, that is compatible with maven-scm api. It implements the parsing of the repo manifest xml file, and call jgit sub-commands
You can test it by recompiling maven-scm, then typing either
or better using a new mojo that supports checkout OR update (does not clean the checkout dir if it already exists... so you can execute several times an update, or retry a partially failing checkout )
Notice that their are plenty of http 429 "Too Many Requests" will cloning some apache gitbox repositories, so this PR also contains in a separate commit a workaround for try-catch-retry on theses errors.
Remark 1:
It is implemented s a standard "composite design-pattern" on scm repository api, eventhough the current implementation that parse manifest.xml implicitely recognise jgit sub-repositories only.
By detecting other file format, it would be possible to mix git/hg/svn.. sub repositories
Remark 2:
I named this scm type 'mount-repos' instead of 'repo' (the original name of the google repo tool) because it looks like a mount-tab file in linux: it mounts some sub-dirs to delegate to other (scm) filesystems api.
Remark 3:
For reason 1 & 2, it makes sense to be properly integrated as a maven-scm provider type. It is much more general than simply getting maven own sources code, and could be used in some complex multi-repositories builds.
Remark 4:
Currently, only the checkout and update commands are implemented.
To fully supports maven scm api, we could also implements all remaining methods: diff/status/tag/update/edit/unedit/blame/mkdir/...
@hboutemy ... can you have a look? This work is inspired of problems discussed at hacker garten