无法使用SVN作为Maven repo进行部署

时间:2009-09-04 22:22:25

标签: svn maven-2 version-control maven-scm

我正在尝试使用Subversion作为使用Maven wagon的Maven仓库。如果我使用http作为协议声明快照位置,那么在尝试部署时会从服务器返回409错误(mvn clean deploy)

<snapshotRepository>
        <uniqueVersion>false</uniqueVersion>
        <id>engtools_snapshots</id>
        <name>EngTools Maven Repository</name>
        <url>http://continuum.td.com/svn_repos/maven/snapshots</url>
</snapshotRepository>

当我将协议更改为scm时:svn:http事情变得更加奇怪 - 我得到了几个看似与领域相关的错误

<snapshotRepository>
        <uniqueVersion>false</uniqueVersion>
        <id>engtools_snapshots</id>
        <name>EngTools Maven Repository</name>
        <url>scm:svn:http://continuum.td.com/svn_repos/maven/snapshots</url>
</snapshotRepository>

SCM配置

        <extensions>
        <extension>
            <groupId>org.apache.maven.wagon</groupId>
            <artifactId>wagon-scm</artifactId>
            <version>1.0-beta-6</version>
        </extension>
        <extension>
            <groupId>org.apache.maven.scm</groupId>
            <artifactId>maven-scm-manager-plexus</artifactId>
            <version>1.3-SNAPSHOT</version>
        </extension>
        <extension>
            <groupId>org.apache.maven.scm</groupId>
            <artifactId>maven-scm-provider-svnexe</artifactId>
            <version>1.3-SNAPSHOT</version>
        </extension>
    </extensions>

(mvn deploy)

产生的部分堆栈跟踪
[INFO] [deploy:deploy {execution: default-deploy}]
[INFO] Retrieving previous build number from engtools_snapshots
[FATAL ERROR] org.apache.maven.plugin.deploy.DeployMojo#execute() caused a 
linkage error (java.lang.AbstractMethodError) and may be out-of-date. Check 
the realms:
[FATAL ERROR] Plugin realm = 
app0.child-container[org.apache.maven.plugins:maven-deploy-plugin:2.4]
urls[0] = file:/C:/Documents and Settings/boo/.m2/repository/org/apache/
maven/plugins/maven-deploy-plugin/2.4/maven-deploy-plugin-2.4.jar
urls[1] = file:/C:/Documents and Settings/boo/.m2/repository/org/codehaus/
plexus/plexus-utils/1.1/plexus-utils-1.1.jar
[FATAL ERROR] Container realm = plexus.core
urls[0] = file:/C:/java/apache-maven-2.2.0/bin/../lib/maven-2.2.0-uber.jar
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] org.apache.maven.scm.command.checkout.AbstractCheckOutCommand.
executeCheckOutCommand(Lorg/apache/maven/scm/provider/ScmProviderRepository;
Lorg/apache/maven/scm/ScmFileSet;Lorg/apache/maven/scm/ScmVersion;)
Lorg/apache/maven/scm/command/checkout/CheckOutScmResult;
[INFO] ------------------------------------------------------------------------
[INFO] Trace
java.lang.AbstractMethodError: org.apache.maven.scm.command.checkout.AbstractCheckOutCommand.
executeCheckOutCommand(Lorg/apache/maven/scm/provider/ScmProviderRepository;
Lorg/apache/maven/scm/ScmFileSet;Lorg/apache/maven/scm/ScmVersion;)Lorg/apache/maven/scm/command/checkout/CheckOutScmResult;
 at org.apache.maven.scm.command.checkout.AbstractCheckOutCommand.executeCommand(
AbstractCheckOutCommand.java:49)
 at org.apache.maven.scm.command.AbstractCommand.execute(AbstractCommand.java:58)

1 个答案:

答案 0 :(得分:2)

如果你看看wagon-scm的POM,你会发现它依赖于1.0版本的maven-scm-provider- *工件。在您的扩展部分中,您引用了1.3-SNAPSHOT版本。

从版本1.2开始,AbstractCheckOutCommand的executeCheckOutCommand()方法不再是抽象的,而是委托给另一个带有额外recursive参数的抽象方法。由于此更改,您会收到链接错误。

解决此问题的最简单方法是将maven-scm-provider- *扩展的版本更改为与wagon-scm所需的版本一致,即更改1.0或1.1版本的1.3-SNAPSHOT版本。

值得指出的是,我认为使用SCM系统来托管您的Maven存储库并不是一个好主意,特别是对于SNAPSHOT工件。相反,我建议使用repository manager,它们在托管工件的基础上提供了许多有用的功能。