Uploaded image for project: 'Maven SCM'
  1. Maven SCM
  2. SCM-928

scm type 'mount-repos' to support google repo tool for checkout manifest.xml



    • New Feature
    • Status: Closed
    • Minor
    • Resolution: Won't Fix
    • None
    • None
    • None


      see PullRequest https://github.com/apache/maven-scm/pull/92


      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"


      repo init -u https://gitbox.apache.org/repos/asf/maven-sources.git
      repo sync
      repo start master --all

      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

      mvn org.apache.maven.plugins:maven-scm-plugin:1.11.3-SNAPSHOT:checkout -DconnectionUrl=scm:mount-repos:default.xml -DcheckoutDirectory=checkout

      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 )

      mvn org.apache.maven.plugins:maven-scm-plugin:1.11.3-SNAPSHOT:checkout-or-update -DconnectionUrl=scm:mount-repos:default.xml -DcheckoutDirectory=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/...


        Issue Links



              Unassigned Unassigned
              arnaud.nauwynck Arnaud Nauwynck
              0 Vote for this issue
              2 Start watching this issue