Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] 构建 git submodule 模块时,会在构建日志中报错,但不影响构建结果 #1063

Open
gaosaroma opened this issue Feb 7, 2025 · 0 comments

Comments

@gaosaroma
Copy link
Collaborator

注意:只会在构建日志中报错,不影响构建结果。

issue

构建 git submodule 模块时,会在构建日志中报错,不过不影响构建结果。

预期行为

正常获取到该子项目模块的 git 信息,无需打印报错日志

真实行为

打印了报错日志,虽然不影响构建执行:

Image

复现方式

  1. 在父项目中,通过 git submodule,把某个远程模块作为子项目,并 clone 到本地:
git submodule init
git submodule update
  1. 构建该模块
mvn clean package -Dmaven.test.skip=true -pl 该子项目模块

原因

在 git submodule 中拉取的远程项目中,是没有 .git/config 文件的,只有 .git 文件。该文件中存储了git目录的位置,如:

cat .git
gitdir: ../../.git/modules/XXXXX

该子项目真实的 .git/config 位于 cat ../../.git/modules/XXX/config

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant