You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Michael Osipov (Jira)" <ji...@apache.org> on 2021/05/16 13:50:00 UTC

[jira] [Updated] (SCM-928) scm type 'mount-repos' to support google repo tool for checkout manifest.xml

     [ https://issues.apache.org/jira/browse/SCM-928?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Osipov updated SCM-928:
-------------------------------
    Fix Version/s: waiting-for-feedback

> scm type 'mount-repos' to support google repo tool for checkout manifest.xml
> ----------------------------------------------------------------------------
>
>                 Key: SCM-928
>                 URL: https://issues.apache.org/jira/browse/SCM-928
>             Project: Maven SCM
>          Issue Type: New Feature
>          Components: maven-scm-provider-jgit
>            Reporter: Arnaud Nauwynck
>            Priority: Minor
>             Fix For: waiting-for-feedback
>
>
> 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"
>  
> {code:java}
> repo init -u https://gitbox.apache.org/repos/asf/maven-sources.git
> repo sync
> repo start master --all
> {code}
> 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
> {code:java}
> mvn org.apache.maven.plugins:maven-scm-plugin:1.11.3-SNAPSHOT:checkout -DconnectionUrl=scm:mount-repos:default.xml -DcheckoutDirectory=checkout{code}
> 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 )
> {code:java}
> mvn org.apache.maven.plugins:maven-scm-plugin:1.11.3-SNAPSHOT:checkout-or-update -DconnectionUrl=scm:mount-repos:default.xml -DcheckoutDirectory=checkout{code}
> 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/...



--
This message was sent by Atlassian Jira
(v8.3.4#803005)