Open benjamingarcia opened 6 years ago
Hi Benjamin, thanks for reporting.
Indeed jgitver relies on jgit for that git parsing so if worktree
breaks jgit, then jgitver is also broken.
This seems to be resolved by https://github.com/jgitver/jgitver/commit/e42d69b2aa2d05bd38433f50fd00d75153380412 Could you release a new version, please?
Issue
1.2.1: replace with the version of the jgtiver-maven-plugin you have the issue with
usage context:
Problem description:
git worktree
since a few weeks, and when I try to build with maven, I have this error :[WARNING] cannot autoclose GitVersionCalculator object for project: /home/dev/projet/fix java.lang.IllegalStateException: failure calculating version at fr.brouillard.oss.jgitver.GitVersionCalculator.buildVersion (GitVersionCalculator.java:312) at fr.brouillard.oss.jgitver.GitVersionCalculator.getVersionObject (GitVersionCalculator.java:144) at fr.brouillard.oss.jgitver.GitVersionCalculator.getVersion (GitVersionCalculator.java:203) at fr.brouillard.oss.jgitver.GitVersionCalculator.meta (GitVersionCalculator.java:512) at fr.brouillard.oss.jgitver.JGitverExtension.afterSessionStart (JGitverExtension.java:93) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:210) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290) at org.apache.maven.cli.MavenCli.main (MavenCli.java:194) at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:498) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289) at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415) at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356) Caused by: org.eclipse.jgit.errors.NoWorkTreeException: Bare Repository has neither a working tree, nor an index at org.eclipse.jgit.lib.Repository.getWorkTree (Repository.java:1356) at org.eclipse.jgit.treewalk.FileTreeIterator. (FileTreeIterator.java:115)
at org.eclipse.jgit.treewalk.FileTreeIterator. (FileTreeIterator.java:97)
at org.eclipse.jgit.api.StatusCommand.call (StatusCommand.java:139)
at fr.brouillard.oss.jgitver.impl.GitUtils.isDirty (GitUtils.java:51)
at fr.brouillard.oss.jgitver.GitVersionCalculator.buildVersion (GitVersionCalculator.java:209)
at fr.brouillard.oss.jgitver.GitVersionCalculator.getVersionObject (GitVersionCalculator.java:144)
at fr.brouillard.oss.jgitver.GitVersionCalculator.getVersion (GitVersionCalculator.java:203)
at fr.brouillard.oss.jgitver.GitVersionCalculator.meta (GitVersionCalculator.java:512)
at fr.brouillard.oss.jgitver.JGitverExtension.afterSessionStart (JGitverExtension.java:93)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:210)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)