我有一个与所问问题类似的问题here https://stackoverflow.com/questions/31159484/mavengit-commit-id-plugin-git-directory-could-not-be-found-please-specify-a,但没有答案。
Maven 项目中有以下结构(这是标准的):
parent-pom - which is a parent for all others
|_reactor - which is a concrete project, parent-pom is a parent
|_module_1 - reactor is a parent
|_module_2
...
|_module_n
git-commit-id-plugin 在parent-pom 中配置,而不是在其他地方配置。
直到最近一切都很好:我能够使用 mvn clean install 分别构建整个 Reactor 项目和所有模块。
然后我添加了一个新模块(比如说 module_n1),我相信构建一直进展顺利,直到大规模合并。
现在我得到以下情况:reactor构建成功,每个模块分别从1到n构建成功。
但 module_n1 失败并出现以下错误:
[ERROR] Failed to execute goal pl.project13.maven:git-commit-id-plugin:2.1.7:revision (default) on project module_n1: .git directory could not be found! Please specify a valid [dotGitDirectory] in your pom.xml
reactor模块下有一个.git文件夹。作为实验,我删除了它,但其他模块也出现了相同的错误。
某个特定模块在构建过程中找不到 .git 文件夹的原因可能是什么?
Thanks.
自版本以来2.0.4
旗帜failOnNoGitDirectory
is true
默认情况下。将标志设置为false
以确保在以下情况下跳过此目标.git
目录不存在。
<build>
<plugins>
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
<configuration>
<failOnNoGitDirectory>false</failOnNoGitDirectory>
</configuration>
</plugin>
</plugins>
</build>
该插件有一个搜索的内部逻辑.git
项目当前目录和父目录中的存储库。如果多模块项目位于同一个 git 存储库下,我不会太担心。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)