When checking out the openapi-generator code in a git worktree, compilation will not work.
Bug was introduced in e14e5fccf395c939176cb44d51a870afeefa1ee8 due to the inclusion of git-commit-id-plugin.
git clone https://github.com/openapitools/openapi-generator
cd openapi-generator
git worktree add ../openapi-generator-dev
cd ../openapi-generator-dev
mvn clean package
This will throw an error:
[ERROR] Failed to execute goal pl.project13.maven:git-commit-id-plugin:4.0.0:revision (get-the-git-infos) on project openapi-generator: Could not complete Mojo execution...: Error: Could not
get HEAD Ref, are you sure you have some commits in the dotGitDirectory? -> [Help 1]
This is caused by missing git worktree support in git-commit-id-maven-plugin.
That in turn is caused by the feature missing in JGit
A possible approach would be to disable the plugin -Dmaven.gitcommitid.skip=true during compilation. This will make openapi-generator (core library) compile successfully, but cause test errors in openapi-generator (executable) unfortunately.
Not sure how a proper fix would look like. At least this behaviour should be documented somewhere.
I have a fix for this in #6094
Thanks for the quick response. I have tested the PR and it works well for me.
Thanks for validating!
Most helpful comment
Thanks for the quick response. I have tested the PR and it works well for me.