-
Notifications
You must be signed in to change notification settings - Fork 304
Closed
Milestone
Description
With the following configuration:
<configuration>
<prefix>git</prefix>
<dateFormat>yyyy-MM-dd'T'HH:mm:ssZZ</dateFormat>
<verbose>true</verbose>
<skipPoms>true</skipPoms>
<generateGitPropertiesFile>false</generateGitPropertiesFile>
<failOnNoGitDirectory>false</failOnNoGitDirectory>
<abbrevLength>10</abbrevLength>
<useNativeGit>true</useNativeGit>
<gitDescribe>
<always>false</always>
<abbrev>7</abbrev>
<dirty>-dirty</dirty>
<forceLongFormat>false</forceLongFormat>
</gitDescribe>
</configuration>the plugin crashes on a repo without tags:
java.lang.RuntimeException: Failed to execute git command (`git describe --dirty=-dirty --match=* --abbrev=7` @ /home/henning/code/dropwizard/floplizard/floplizard-guice)!
at pl.project13.maven.git.NativeGitProvider.runGitCommand(NativeGitProvider.java:277)
at pl.project13.maven.git.NativeGitProvider.tryToRunGitCommand(NativeGitProvider.java:242)
at pl.project13.maven.git.NativeGitProvider.getGitDescribe(NativeGitProvider.java:92)
at pl.project13.maven.git.GitDataProvider.maybePutGitDescribe(GitDataProvider.java:120)
at pl.project13.maven.git.GitDataProvider.loadGitData(GitDataProvider.java:88)
at pl.project13.maven.git.GitCommitIdMojo.loadGitDataWithNativeGit(GitCommitIdMojo.java:508)
at pl.project13.maven.git.GitCommitIdMojo.loadGitData(GitCommitIdMojo.java:491)
at pl.project13.maven.git.GitCommitIdMojo.execute(GitCommitIdMojo.java:351)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:355)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:216)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:160)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
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: java.io.IOException: Git command exited with invalid status [128]: stdout: ``, stderr: `fatal: No names found, cannot describe anything.`
at pl.project13.maven.git.NativeGitProvider$JavaProcessRunner.run(NativeGitProvider.java:321)
at pl.project13.maven.git.NativeGitProvider.runGitCommand(NativeGitProvider.java:273)
... 28 more
when running git describe. The jgit provider behaves silently as if --always was given:
...
[info] git.commit.id.describe 034d5be-dirty
...
When setting always to true in the configuration, the native provider behaves correctly.
Either the always setting is useless (then it should be removed) or both providers should behave the same (exit with an error message, not one crashing and one silently ignoring the setting).
Metadata
Metadata
Assignees
Labels
No labels