如何将Maven Release Plugin从SVN迁移到Git?
问题描述:
我们正在将我们的项目从SVN转移到Git。我们使用Maven发行插件mvn release:prepare
和mvn release:perform
我们的软件包。如何将Maven Release Plugin从SVN迁移到Git?
除此之外,我们正在修改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>
答
你可以试试下面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>
+0
依赖已经是maven-release-plugin的一部分,不需要再次定义它... – khmarbaise
能否请您确认,如果你是在一个正确的Git项目和POM文件与GIT SCM URL? –
@RishikeshDarandale,很好的问题。是的,我现在三重检查,只是为了确保。我从包含pom.xml的本地文件夹中运行命令,该文件夹是正确的项目并匹配相应的git回购。 – AlexScript
嗯,一切看起来不错。你可以尝试更新插件版本到'2.5.3'吗? –