1

我正在尝试从 svn 签出代码。我写了一个 pom.xml 来做同样的事情。下面是我的代码。

<scm>
    <connection>scm:svn:http://10.6.15.103/svn/PLM_Windchill_MidMarket/PLM_Windchill_MidMarket</connection>
    <developerConnection>scm:svn:http://10.6.15.103/svn/PLM_Windchill_MidMarket/PLM_Windchill_MidMarket</developerConnection>
</scm>
<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-scm-plugin</artifactId>
            <version>1.7</version>
            <configuration>
                <checkoutDirectory>${project.basedir}/src/svn</checkoutDirectory>
                <workingDirectory>${project.basedir}/src/svn</workingDirectory>
            </configuration>
        </plugin>
    </plugins>
</build>

当我运行 mvn scm:checkout install 时,出现以下错误:

 Failed to execute goal org.apache.maven.plugins:maven-scm-plugin:1.7:checkout (default-cli) on project test_project1: Cannot run checkout command : Can't load the scm provider. Guice provision errors:

 1) Error in custom provider, java.lang.TypeNotPresentException: Type org.apache.maven.scm.provider.cvslib.cvsjava.CvsJavaScmProvider not present
 at ClassRealm[plugin>org.apache.maven.plugins:maven-scm-plugin:1.7, parent: sun.misc.Launcher$AppClassLoader@5acac268]
 at ClassRealm[plugin>org.apache.maven.plugins:maven-scm-plugin:1.7, parent: sun.misc.Launcher$AppClassLoader@5acac268]
 while locating org.apache.maven.scm.provider.ScmProvider annotated with @com.google.inject.name.Named(value=cvs)

 1 error: org/apache/maven/scm/provider/cvslib/AbstractCvsScmProvider: org.apache.maven.scm.provider.cvslib.AbstractCvsScmProvider

我可以知道如何解决这个问题吗?

4

1 回答 1

0

看起来您可能遇到了这个错误: https ://bugzilla.redhat.com/show_bug.cgi?id=962273#c1

在错误中,它建议使用 cvs_native 实现而不是 Java 实现。您可以通过如下更改插件配置来做到这一点:

<project>
    ...
    <build>
        <plugins>
            <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>
</project>

另外作为旁注,最新版本的 scm 插件是1.8.1,也许移动到最新版本会解决您的问题。

于 2013-07-23T07:48:54.057 回答