Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #6072
Closed
Open
Issue created Apr 27, 2020 by Administrator@rootContributor4 of 4 checklist items completed4/4 checklist items

[BUG] Regression: Compilation fails with git worktree

Created by: bodograumann

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • What's the version of OpenAPI Generator used?
  • Have you search for related issues/PRs?
  • What's the actual output vs expected output?
Description

When checking out the openapi-generator code in a git worktree, compilation will not work.

openapi-generator version
  • master

Bug was introduced in e14e5fcc due to the inclusion of git-commit-id-plugin.

Steps to reproduce
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]

Related issues/PRs

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

Suggest a fix

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.

Assignee
Assign to
Time tracking