[ 
https://issues.apache.org/jira/browse/SCM-928?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17963678#comment-17963678
 ] 

ASF GitHub Bot commented on SCM-928:
------------------------------------

jira-importer opened a new issue, #1151:
URL: https://github.com/apache/maven-scm/issues/1151

   **[Arnaud 
Nauwynck](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=arnaud.nauwynck)**
 opened 
**[SCM-928](https://issues.apache.org/jira/browse/SCM-928?redirect=false)** and 
commented
   
   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"
   
    
   
   ```java
   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
   
   ```java
   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 )
   
   ```java
   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/...
   
   
   ---
   
   **Remote Links:**
   - [GitHub Pull Request #92
   ](https://github.com/apache/maven-scm/pull/92)
   




> 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 (Moved to GitHub Issues)
>          Issue Type: New Feature
>          Components: maven-scm-provider-jgit
>            Reporter: Arnaud Nauwynck
>            Priority: Minor
>
> 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.20.10#820010)

Reply via email to