首页 > 解决方案 > 在 Jenkins 上使用 maven-release-plugin 发布时出错

问题描述

我得到了一份构建 java maven 项目的 Jenkins 工作。

现在我尝试通过 Jenkins(执行 Maven 发布)发布版本,但它失败了。

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.5:prepare (default-cli) on project MyProject: Unable to check for local modifications
[ERROR] Provider message:
[ERROR] The svn command failed.
[ERROR] Command output:
[ERROR] svn: E155036: Please see the 'svn upgrade' command
[ERROR] svn: E155036: The working copy at '/var/lib/hudson/workspace/JobName/MyProject'
[ERROR] is too old (format 8) to work with client version '1.9.5 (r1770682)' (expects format 31). You need to upgrade the working copy first.
[ERROR] -> [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/MojoFailureException

pom中的插件配置为:

   <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
        <version>2.5</version>
        <configuration>
            <tagBase>http://svn.example.org/myproject/tags/_modules</tagBase>
        </configuration>
    </plugin>

我现在不确定,但过去它是有效的。
我不明白的是 maven-release-plugin 没有使用本地 svn 客户端?
从错误消息看来是这样(svn upgrade),如果是这样,为什么它在发布时失败但在结帐时却失败了?
有没有办法在不改变詹金斯的情况下解决这个问题?

我尝试添加以下内容,因为我知道这应该强制插件使用应该兼容的提供程序:

  <dependencies>
    <dependency>
      <groupId>com.google.code.maven-scm-provider-svnjava</groupId>
      <artifactId>maven-scm-provider-svnjava</artifactId>
      <version>2.0.6</version>
      <scope>compile</scope>
    </dependency>
  </dependencies>

但我收到以下错误:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.5:prepare (default-cli) on project MyApp: Unable to commit files
[ERROR] Provider message:
[ERROR] SVN commit failed.
[ERROR] Command output:
[ERROR] svn: E170001: Commit failed (details follow):
[ERROR] svn: E170001: MKACTIVITY of '/products/MyAppsAgregator/!svn/act/24d46a73-6601-0010-864c-7b76c8107c40': 403 Forbidden (http://svn.example.org)
[ERROR] -> [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.

标签: mavenjenkinssvnmaven-release-plugin

解决方案


推荐阅读