早期在 svn 上的一个项目最近被转移到 github,之后我在创建构建时遇到了这个问题。它无法生成内部版本号并出现以下错误
Failed to execute goal org.codehaus.mojo:buildnumber-maven-plugin:1.4:create (default) on project line-management: An error has occurred while checking scm status. Exception while executing SCM command. Error while executing command. Error while executing process. Cannot run program "svn" (in directory "D:\workspace\project_git\project_management"): CreateProcess error=2, The system cannot find the file specified -> [Help 1]
pom.xml代码
<scm>
<connection>scm:svn:http://some.svn.url/</connection>
</scm>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>buildnumber-maven-plugin</artifactId>
<version>1.4</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>create</goal>
</goals>
</execution>
</executions>
<configuration>
<doCheck>true</doCheck>
<doUpdate>false</doUpdate>
<timestampFormat>{0,date,"yyyyMMddHHmmss"}</timestampFormat>
<timestampPropertyName>buildNumVar</timestampPropertyName>
<shortRevisionLength>10</shortRevisionLength>
</configuration>
</plugin>
最佳答案
您的 scm 标记仍然包含旧 svn 存储库的连接字符串。
您应该在此处提供新 git 存储库的 url,例如 <connection>scm:git:https://github.com/your-git-repo.git</connection>
。连接字符串的详细信息请查看here .
关于java - Git 存储库的内部版本号 Maven 插件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48641593/