2

我有一个 mavenized 项目,当我尝试发布时,出现以下错误:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.4
.2:prepare (default-cli) on project SimpleWeb: Unable to check for local modific
ations
[ERROR] Provider message:
[ERROR] SVN status failed.
[ERROR] Command output:
[ERROR] svn: '' is not a working copy

我有以下问题:

  1. POM 文件中如何给出 scm 配置
  2. 如果与 scm 的通信应该通过 https 进行,我们如何在客户端配置证书
  3. 发布应该从分支或主干发生

我的scm配置如下:

<scm>
    <connection>scm:svn:https://domain.com/svn/New_FW/CI_POC/SimpleWeb/trunk</connection>
    <developerConnection>scm:svn:https://domain.com/svn/New_FW/CI_POC/SimpleWeb/trunk</developerConnection>
    <url>https://domain.com/svn/New_FW/CI_POC/SimpleWeb/trunk</url>
</scm>

我的maven发布插件配置如下:

<plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-scm-plugin</artifactId>
      <version>1.3</version>
      <configuration>
        <providerImplementations>
          <svn>javasvn</svn>
        </providerImplementations>
        <username>${scm.username}</username>                            
        <password>${scm.password}</password>
      </configuration>
      <dependencies>
        <dependency>
          <groupId>com.google.code.maven-scm-provider-svnjava</groupId>
          <artifactId>maven-scm-provider-svnjava</artifactId>
          <version>1.14</version>
        </dependency>
      </dependencies>
</plugin>            
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-release-plugin</artifactId>
    <version>2.4.2</version>
    <dependencies>
        <dependency>    
        <groupId>com.google.code.maven-scm-provider-svnjava</groupId>
        <artifactId>maven-scm-provider-svnjava</artifactId>
        <version>1.6</version>
        </dependency>
    </dependencies>
    <configuration>
        <providerImplementations>
            <svn>javasvn</svn>
        </providerImplementations>
        <tagBase>https://domain-inc.com/svn/New_FW/CI_POC/SimpleWeb/tags</tagBase>
        <mavenExecutorId>forked-path</mavenExecutorId>
    </configuration>
</plugin>

我在这里受到打击,无法继续前进。请帮助/指导我解决问题。当我通过在 Jenkins 中配置 Maven 发布插件运行相同的操作时,我得到一个不同的错误:“svn:需要身份验证”。为什么会有这个区别。

4

1 回答 1

1

在 Windows Jenkins slave 上,我对多 maven 项目有同样的问题。为了修复它,我添加了:

...
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-release-plugin</artifactId>
    ...
    <configuration>
        <commitByProject>true</commitByProject>
        ...
    </configuration>
...
于 2014-07-14T06:29:55.047 回答