0
我想用maven克隆存儲庫,並且認證必須使用現有的ssh-agent。如何使用使用ssh-agent的maven克隆克隆?
我當前插件配置:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-scm-plugin</artifactId>
<version>1.9.4</version>
<configuration>
<providerImplementations>
<git>jgit</git>
</providerImplementations>
</configuration>
<dependencies>
<dependency>
<groupId>org.apache.maven.scm</groupId>
<artifactId>maven-scm-provider-jgit</artifactId>
<version>1.9.4</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>clone-github-wiki</id>
<goals>
<goal>checkout</goal>
</goals>
<phase>generate-resources</phase>
<configuration>
<checkoutDirectory>${project.basedir}/target/github-wiki</checkoutDirectory>
<connectionType>connection</connectionType>
<connectionUrl>scm:git:[email protected]:xyz/abc.wiki.git</connectionUrl>
</configuration>
</execution>
</executions>
</plugin>
認證失敗:
[INFO] --- maven-scm-plugin:1.9.4:checkout (clone-github-wiki) @ xyz-doc ---
[INFO] Change the default 'git' provider implementation to 'jgit'.
[INFO] Removing /home/jenkins/abc/doc/target/github-wiki
[INFO] cloning [master] to /home/jenkins/abc/doc/target/github-wiki
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.490 s
[INFO] Finished at: 2015-10-14T11:45:40+02:00
[INFO] Final Memory: 15M/241M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-scm-plugin:1.9.4:checkout (clone-github-wiki) on project xyz-doc: Cannot run checkout command : Exception while executing SCM command. JGit checkout failure! [email protected]:abc/xyz.wiki.git: Auth fail -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles: