如何做mvn scm插件匿名pserver cvs访问

时间:2011-10-29 22:24:57

标签: java maven cvs

我想使用maven scm插件从匿名用户的CVS导出我的代码。我没有使用CVS客户端以便于使用(下载mvn和eclipse,你可以在任何平台上加入我的项目)。

但是,我似乎无法通过匿名pserver访问来获取mvn scm插件来检出代码。它抱怨CVS需要密码。我错过了什么吗?这是我正在执行的命令:

mvn scm:export 
    -DconnectionUrl=scm:cvs:pserver:anonymous@speedforge.cvs.sourceforge.net:/cvsroot/speedforge:speedforge 
    -DexportDirectory=export 
    -DscmVersion=v004 
    -DscmVersionType=tag

(你可以直接运行它,它是source forge上的一个开源项目)

我从scm插件中收到以下错误:

org.netbeans.lib.cvsclient.connection.AuthenticationException: Wrong Password.

我在mac上使用mvn 2.2.1:

mvn -version
Apache Maven 2.2.1 (r801777; 2009-08-06 21:16:01+0200)
Java version: 1.6.0_26
Java home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
Default locale: en_US, platform encoding: MacRoman
OS name: "mac os x" version: "10.7.2" arch: "x86_64" Family: "mac"

虽然mvn scm文档似乎提到匿名cvs访问,但它并没有真正提供如何做到这一点的示例:http://maven.apache.org/scm/cvs.html

有人可以帮助我使用mvn scm插件获取匿名pserver访问权限吗?

谢谢!

2 个答案:

答案 0 :(得分:0)

尝试在网址中提供空密码:

mvn scm:export 
  -DconnectionUrl=scm:cvs:pserver:anonymous:@speedforge.cvs.sourceforge.net:/cvsroot/speedforge:speedforge 
  -DexportDirectory=export 
  -DscmVersion=v004 
  -DscmVersionType=tag

(注意用户名和:之间的额外@ - 将凭证与主机名分开。)

答案 1 :(得分:0)

同样的命令在我的带有maven 3的linux盒子上适用于我。输出如下以供参考。您可能还想检查使用的插件版本。

$ mvn scm:export -DconnectionUrl=scm:cvs:pserver:anonymous@speedforge.cvs.sourceforge.net:/cvsroot/speedforge:speedforge -DexportDirectory=speedforge -DexportDirectory=export -DscmVersion=v004 -DscmVersionType=tag
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-scm-plugin:1.5:export (default-cli) @ standalone-pom ---
[INFO] Executing: /bin/sh -c cd /home/user/work-folder/export && cvs -z3 -f -d :pserver:anonymous@speedforge.cvs.sourceforge.net:/cvsroot/speedforge -q export -rv004 speedforge
[INFO] Working directory: /home/user/work-folder/export
[ERROR] Didn't find password for CVSROOT ':pserver:anonymous@speedforge.cvs.sourceforge.net:/cvsroot/speedforge'.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8.275s
[INFO] Finished at: Mon Oct 31 07:53:40 IST 2011
[INFO] Final Memory: 4M/15M
[INFO] ------------------------------------------------------------------------

$ mvn -v
Apache Maven 3.0.3 (r1075438; 2011-02-28 23:01:09+0530)
Maven home: /usr/local/maven
Java version: 1.6.0_25, vendor: Sun Microsystems Inc.
Java home: /usr/local/jdk1.6.0_25/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.0.0-12-generic", arch: "i386", family: "unix"