Git-commit-id-maven-plugin: Cannot save config file 'FileBasedConfig[H:\.config\jgit\config]'

Created on 8 Jul 2021  路  6Comments  路  Source: git-commit-id/git-commit-id-maven-plugin

Describe the bug

During maven build, we observe the following error message from git-commit-id-maven-plugin 4.0.5:

Cannot save config file 'FileBasedConfig[H:\.config\jgit\config]'

The H: drive is a network drive where our home dir is set

Steps to Reproduce

  • mvn -version
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: C:\Users\<redacted>\tools\maven\3.6.3
Java version: 1.8.0_201, vendor: Oracle Corporation, runtime: C:\Program Files\Java\JDK8\jre
Default locale: en_GB, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
  • Plugin config:
      <plugin>
        <groupId>pl.project13.maven</groupId>
        <artifactId>git-commit-id-plugin</artifactId>
        <version>4.0.5</version>
        <configuration>
          <failOnNoGitDirectory>false</failOnNoGitDirectory>
          <offline>true</offline>
        </configuration>
      </plugin>
  • no public build
  • Observed error:
    Cannot save config file 'FileBasedConfig[H:\.config\jgit\config]'

This error doesn not prevents the maven build from being executed with success. However, intelliJ Community 2019.3 spots it as an error:
image

Expected behavior

  • no error message printed

Additional context

This might be similar to https://www.eclipse.org/forums/index.php/t/1103395/

bug

All 6 comments

Hello,
thank you for reporting this issue here! When I read the linked ticket (https://bugs.eclipse.org/bugs/show_bug.cgi?id=566170) correctly this should be fixed whenever we update the jgit-library to version 5.9?!?

For the time being you could potentially switch to the native git binary via <useNativeGit>true</useNativeGit> which would help avoid that issue since it doesn't rely on jgit.

Ah I just realized that this is essentially a duplicate of https://github.com/git-commit-id/git-commit-id-maven-plugin/issues/518. At least it's the same issue. Perhaps a different context....not sure if I should keep both issues open, but I guess it doesn't hurt either.

The difference with #518 is that there the build fails while in this case it does not

thanks for the useNativeGit tip!

thanks for pointing out that difference!
Could you perhaps also confirm which version you are using?
If you are on 4.0.5 this should already include jgit 5.12.0.202106070339-r (see https://github.com/git-commit-id/git-commit-id-maven-plugin/blob/v4.0.5/core/pom.xml#L20). Based on the closed bug report (https://bugs.eclipse.org/bugs/show_bug.cgi?id=566170) this should have been fixed in 5.9.X....hence this would make me suspect that it is not fixed properly and would deserve a new ticket, or to have the old to be reopened.

Same problem here with 4.9.10:

[INFO] --- git-commit-id-plugin:4.9.10:revision (default) ...
[ERROR] Cannot save config file 'FileBasedConfig[H:\.config\jgit\config]'
java.io.IOException: Creating directories for H:\.config\jgit failed

<useNativeGit>false</useNativeGit>

doesn't make a difference

Sorry it should have been <useNativeGit>true</useNativeGit> I have updated my initial comment.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

delanym picture delanym  路  7Comments

Punkoivan picture Punkoivan  路  3Comments

vadimkim picture vadimkim  路  7Comments

VK2BEA picture VK2BEA  路  5Comments

TheSnoozer picture TheSnoozer  路  7Comments