mavanagaiata fails on a totally empty repository #27

Closed
hgschmie opened this Issue Mar 15, 2013 · 3 comments

Comments

Projects
None yet
2 participants
Contributor

hgschmie commented Mar 15, 2013

[ERROR] Failed to execute goal com.github.koraktor:mavanagaiata:0.5.0:commit (default) on project facebook-base-pom: Execution default of goal com.github.koraktor:mavanagaiata:0.5.0:commit failed. NullPointerException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.github.koraktor:mavanagaiata:0.5.0:commit (default) on project facebook-base-pom: Execution default of goal com.github.koraktor:mavanagaiata:0.5.0:commit failed.
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:225)
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:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
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:601)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default of goal com.github.koraktor:mavanagaiata:0.5.0:commit failed.
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:110)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more
Caused by: java.lang.NullPointerException
at org.eclipse.jgit.lib.ObjectIdOwnerMap.get(ObjectIdOwnerMap.java:131)
at org.eclipse.jgit.revwalk.RevWalk.parseAny(RevWalk.java:815)
at org.eclipse.jgit.revwalk.RevWalk.parseCommit(RevWalk.java:730)
at com.github.koraktor.mavanagaiata.git.jgit.JGitRepository.getCommit(JGitRepository.java:252)
at com.github.koraktor.mavanagaiata.git.jgit.JGitRepository.getHeadCommit(JGitRepository.java:187)
at com.github.koraktor.mavanagaiata.git.jgit.JGitRepository.getHeadCommit(JGitRepository.java:45)
at com.github.koraktor.mavanagaiata.mojo.GitCommitMojo.run(GitCommitMojo.java:50)
at com.github.koraktor.mavanagaiata.mojo.AbstractGitMojo.execute(AbstractGitMojo.java:150)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
... 20 more

% git log
fatal: bad default revision 'HEAD'

(cloned freshly created repo from github)

Owner

koraktor commented Mar 15, 2013

Nice catch, never tried this. 😏

koraktor added a commit that referenced this issue Apr 5, 2013

Handle invalid refs
JGitRepository#getHeadObject() will now provide better exceptions if HEAD
or some other ref cannot be resolved properly.

See #27
Owner

koraktor commented Apr 5, 2013

The commit above changed JGitRepository#getHeadObject() to throw a more descriptive exception. IMO, this would be a good point to throw a MojoFailureException in the mojos (#27) so it doesn't break the whole build.

Owner

koraktor commented Jul 23, 2013

This should be unproblematic with the changes from version 0.6.0.

@koraktor koraktor closed this Jul 23, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment