簡體   English   中英

如何使用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

更多詳情可在這找到:

如何使用Windows命令提示符下的CVS命令從頭檢出項目

我花了很多時間,但找不到使用Maven SCM插件的解決方案。 此外,Maven SCM插件的文檔也不是很好。

我可以使用ant插件(maven-antrun-plugin)解決問題。 有關詳細解決方案,請參閱

使用MAVEN ANT插件進行CVS Checkout

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM