为Git配置Maven Release Plugin

时间:2016-01-05 16:30:09

标签: git maven

我正在尝试学习如何使用Maven Release Plugin。我让我的pom看起来像:

<modelVersion>4.0.0</modelVersion>

<groupId>com.sample</groupId>
<artifactId>sample-project</artifactId>
<version>1.0-SNAPSHOT</version>

<scm>
    <connection>scm:git:git@github.com:sample/sample-project.git</connection>
    <developerConnection>scm:git:[fetch=]central[push=]origin</developerConnection>
    <url>https://github.com/sample/sample-project</url>
</scm>

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-release-plugin</artifactId>
            <version>2.5.3</version>
        </plugin>
    </plugins>
</build>

central配置为原始仓库,origin是仓库的分支。

当我尝试运行mvn release:prepare时,我收到此错误:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.5.3:prepare (default-cli) on project mindmaps-reasoner: Unable to commit files
[ERROR] Provider message:
[ERROR] The svn command failed.
[ERROR] Command output:
[ERROR] svn: E155007: '/Users/XXXX/IdeaProjects/sample-project/pom.xml' is not a working copy
[ERROR] -> [Help 1]

为什么认为这是一个svn回购?

我错过了什么才能让它发挥作用?在我的~/.scm/git-settings.xml我有:

<git-settings>
    <commitNoVerify>false</commitNoVerify>
</git-settings>

修改

运行mvn -X release:prepare后,我注意到有关svn正在打印的这些行:

[DEBUG]          org.apache.maven.scm:maven-scm-provider-svnexe:jar:1.9.4:runtime
[DEBUG]       org.apache.maven.scm:maven-scm-provider-svn-commons:jar:1.9.4:compile
[DEBUG]   Included: org.apache.maven.scm:maven-scm-provider-svnexe:jar:1.9.4
[DEBUG]   Included: org.apache.maven.scm:maven-scm-provider-svn-commons:jar:1.9.4
[INFO] Executing: /bin/sh -c cd /Users/fppt/IdeaProjects/mindmaps-reasoner && svn --non-interactive commit --file /var/folders/rj/brkjtdr923l6rgpsyzn_fz280000gn/T/maven-scm-691796700.commit --targets /var/folders/rj/brkjtdr923l6rgpsyzn_fz280000gn/T/maven-scm-9030672937887012174-targets
[ERROR] The svn command failed.
[ERROR] svn: E155007: '/Users/fppt/IdeaProjects/sample-project/pom.xml' is not a working copy

不确定这是否会提供更多信息。

0 个答案:

没有答案