Hequn Cheng created FLINK-18655: ----------------------------------- Summary: 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: Runtime / Configuration Affects Versions: 1.11.0 Reporter: Hequn Cheng Assignee: Hequn Cheng
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. -- This message was sent by Atlassian Jira (v8.3.4#803005)