java - Git 存储库的内部版本号 Maven 插件

标签 java git maven svn version-control

早期在 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/

相关文章:

java - 新鲜的Springboot项目无法启动,原因是: java. lang.ClassNotFoundException : javax. persistence.EntityManagerFactory

java - Maven 中的 SOAPUI 测试报告

java - 如何以编程方式在表之间传输大量数据?

git - 为什么 `rm -rf` 在 git post-receive hook 中使用时的行为与 shell 不同?

java - 在 Elasticsearch 中使用 NativeSearchQueryBuilder 时,如果与 multiMatchQuery 结合使用,rangequery 过滤器会失败

git - 创建一个 GitHub webhook,用于何时接受 pull 请求并将其 merge 到 master

git - 暂时 merge 了一个分支到我们的开发分支,想要撤消

maven - jmeter 分析插件 IllegalArgumentException : Null or zero length 'values' argument

java - TestNG 两类一测

java - 使用 Dockerfile 将 excel (.xls) 文件复制到容器