如何将Maven Release Plugin从SVN迁移到Git?

时间:2017-07-25 17:19:12

标签: git maven maven-release-plugin

我们正在将项目从SVN转移到Git。我们将Maven Release Plugin用于mvn release:preparemvn release:perform我们的软件包。

除此之外,我们正在修改pom.xml文件scm属性以指向我们的git存储库。

但是,当我们运行mvn release:prepare时,我们会收到以下错误:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.5.1: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' is not recognized as an internal or external command,
[ERROR] operable program or batch file.
[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

为什么它仍在尝试执行cmd.exe /X /C "svn --non-interactive status"? 还需要配置什么才能完全迁移此版本流程?

我的pom.xml上下文详细信息:

<scm>
    <connection>scm:git:https://myGitProjectUrl.git</connection>
    <developerConnection>scm:git:https://myGitProjectUrl.git</developerConnection>
    <url>https://myGitProjectUrl</url>
</scm>
...
<build>
    <plugins>
        <!-- Maven Release Plugin -->
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-release-plugin</artifactId>
            <version>2.5.1</version>
            <configuration>
                <goals>deploy</goals>
            </configuration>
        </plugin>

1 个答案:

答案 0 :(得分:0)

您可以在plugin以下maven-invoker依赖项下尝试

 <build>
    <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-release-plugin</artifactId>
          <version>2.5.1</version>
          <dependencies>
            <dependency>
              <groupId>org.apache.maven.shared</groupId>
              <artifactId>maven-invoker</artifactId>
              <version>2.2</version>
            </dependency>
          </dependencies>
        </plugin>
    </plugins>