如何使用 Maven 从 CVS 检出代码

How to checkout code from CVS using Maven

我正在寻找以下内容。

  1. 如何从 CVS 检出代码

  2. 如何从 CVS 签入和更新代码

我的CVS服务器名称:cecvs02dv可以使用用户名和密码访问(不能通过HTTP访问)

CVS文件夹:c:\cvs\dev

模块名称:i3LOC

CVS 的连接配置

<scm>

<connection>scm:cvs:ext:cecvs02dv:c:\cvs\dev:i3LOC</connection>

</scm>

初始 POM XML

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.td.insurance</groupId>
<artifactId>Test</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>Test</name>
<url>http://maven.apache.org</url>

<scm>

<connection>scm:cvs:ext:cecvs02dv:c:\cvs\dev:i3LOC</connection>

</scm>
<dependencies>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>3.8.1</version>
        <scope>test</scope>
    </dependency>

    <dependency>
        <groupId>com.td.insurance</groupId>
        <artifactId>batchframework</artifactId>
        <version>1.4</version>
    </dependency>

</dependencies>

<build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
        <version>2.0-beta-9</version>
        <configuration>
           <useReleaseProfile>false</useReleaseProfile>
           <goals>deploy</goals>
           <scmCommentPrefix>[bus-core-api-release-checkin]-</scmCommentPrefix>
        </configuration>
     </plugin>

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>2.3.2</version>
            <configuration>
                <source>1.6</source>
                <target>1.6</target>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-scm-plugin</artifactId>
            <version>1.7</version>
            <configuration>
                <providerImplementations>
                    <cvs>cvs_native</cvs>
                </providerImplementations>
            </configuration>
        </plugin>

    </plugins>
</build>

错误:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-scm-plugin:1.7:update (default-cli) on project Test: Cannot run update command : Ca
n't load the scm provider. The scm url is invalid. -> [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:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

任何提示都会非常有用

已编辑:在 POM.xml

中更改 SCM 标签后
<scm>
<connection>scm:cvs|pserver|username|password@cecvs02dv|c:/cvs/dev|IRM</connection>
 <developerConnection>scm:cvs|pserver|username|password@cecvs02dv|c:/cvs/dev|IRM</developerConnection>
<tag>HEAD</tag>
 <scm>

当我执行命令 mvn scm:checkout 时,它抛出以下错误。

[INFO] Change the default 'cvs' provider implementation to 'cvs_native'.
[INFO] Removing D:\vinu\workspace\Maven\IRM\target\checkout
[INFO] Executing: cmd.exe /X /C "cvs -z3 -f -d     :pserver:username@cecvs02dv:c:/cvs/dev -q checkout -d checkout IRM"
[INFO] Working directory: D:\vinu\workspace\Maven\IRM\target
[ERROR] Provider message:
[ERROR] The cvs command failed.
[ERROR] Command output:
[ERROR] Empty password used - try 'cvs login' with a real password
cvs [checkout aborted]: authorization failed: server cecvs02dv rejected access to     c:/cvs/dev for user username

然而,当我尝试在命令提示符下使用以下命令结帐时,它起作用了

cvs -z3 -f -d :pserver:username:passsword@cecvs02dv:2401:c:\cvs\dev -q checkout -d checkout IRM

可以在此处找到更多详细信息:

我花了很多时间,但找不到使用 Maven SCM 插件的解决方案。 Maven SCM 插件的文档也不是很好。

我可以使用 ant 插件 (maven-antrun-plugin) 解决问题。详细解决方案请参考