[ https://issues.apache.org/jira/browse/FLINK-18655?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Hequn Cheng closed FLINK-18655. ------------------------------- Resolution: Fixed > Set failOnUnableToExtractRepoInfo to false for git-commit-id-plugin in module > flink-runtime > ------------------------------------------------------------------------------------------- > > Key: FLINK-18655 > URL: https://issues.apache.org/jira/browse/FLINK-18655 > Project: Flink > Issue Type: Bug > Components: Build System > Affects Versions: 1.11.1 > Reporter: Hequn Cheng > Assignee: Hequn Cheng > Priority: Major > Labels: pull-request-available > Fix For: 1.12.0, 1.11.2 > > > Exception may be thrown when building source distribution without the .git > folder(for the flink-runtime module): > {code:java} > [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] > {code} > > 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|https://github.com/git-commit-id/git-commit-id-maven-plugin/blob/v4.0.0/maven/src/main/java/pl/project13/maven/git/GitDirLocator.java#L74]. > 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`. -- This message was sent by Atlassian Jira (v8.3.4#803005)