Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-18655

Set failOnUnableToExtractRepoInfo to false for git-commit-id-plugin in module flink-runtime

    XMLWordPrintableJSON

Details

    Description

      Exception may be thrown when building source distribution without the .git folder(for the flink-runtime module):

      [ERROR] Failed to execute goal pl.project13.maven:git-commit-id-plugin:4.0.0:revision (get-the-git-infos) on project flink-runtime_2.11: Could not complete Mojo execution... Error: Could not get HEAD Ref, are you sure you have set the dotGitDirectory property of this plugin to a valid path? -> [Help 1]
      

       

      To solve the problem, we need to add the <failOnUnableToExtractRepoInfo>false</failOnUnableToExtractRepoInfo> configuration in addition to <failOnNoGitDirectory>false</failOnNoGitDirectory> in the pom of flink-runtime.

       

      The reason is the plugin:git-commit-id-plugin would search up all the maven parent project hierarchy until a .git directory is found. For example, if we config dotGitDirectory as /a/b/c/.git and if /a/b/c/.git is invalid, the plugin would search /a/b/.git and /a/.git. However, once the plugin found a /a/.git folder, it would fail on extracting repo info which leads to the failure above. The search logic of the plugin can be found here.

      You can reproduce the exception with:

      • download the 1.11.0 source distribution.
      • put a .git folder under the path (or parent path) of ${project.basedir}/../.git. For example, my dotGitDirectory is: `/Users/hequn.chq/Downloads/flink-1.11.0/flink-runtime/../.git` and there is a .git folder under `/Users/hequn.chq/.git`.

      Attachments

        Issue Links

          Activity

            People

              hequn8128 Hequn Cheng
              hequn8128 Hequn Cheng
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: