After upgrading to JDK 13 got an error.
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
<version>3.0.1</version>
</plugin>
[ERROR] Failed to perform fetch
org.eclipse.jgit.api.errors.TransportException: ssh://[email protected]:7999/api/service.git: USERAUTH fail
at org.eclipse.jgit.api.FetchCommand.call (FetchCommand.java:254)
at pl.project13.maven.git.JGitProvider.fetch (JGitProvider.java:352)
at pl.project13.maven.git.JGitProvider.getAheadBehind (JGitProvider.java:339)
at pl.project13.maven.git.GitDataProvider.lambda$loadGitData$17 (GitDataProvider.java:174)
at pl.project13.maven.git.GitDataProvider.lambda$memoize$23 (GitDataProvider.java:272)
at pl.project13.maven.git.GitDataProvider.lambda$loadGitData$18 (GitDataProvider.java:175)
at pl.project13.maven.git.GitDataProvider.maybePut (GitDataProvider.java:255)
at pl.project13.maven.git.GitDataProvider.loadGitData (GitDataProvider.java:175)
at pl.project13.maven.git.GitCommitIdMojo.loadGitDataWithJGit (GitCommitIdMojo.java:604)
at pl.project13.maven.git.GitCommitIdMojo.loadGitData (GitCommitIdMojo.java:563)
at pl.project13.maven.git.GitCommitIdMojo.execute (GitCommitIdMojo.java:458)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:567)
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)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:567)
at org.apache.maven.wrapper.BootstrapMainStarter.start (BootstrapMainStarter.java:39)
at org.apache.maven.wrapper.WrapperExecutor.execute (WrapperExecutor.java:122)
at org.apache.maven.wrapper.MavenWrapperMain.main (MavenWrapperMain.java:55)
Caused by: org.eclipse.jgit.errors.TransportException: ssh://[email protected]:7999/api/service.git: USERAUTH fail
For reproducibility please provide the following:
the Java-Version is being used (output of java -version and also include details about oracle-jdk VS open-jdk)
openjdk version "13.0.1" 2019-10-15
OpenJDK Runtime Environment Zulu13.28+11-CA (build 13.0.1+10-MTS)
the Maven-Version is being used (output of mvn --version)
Apache Maven 3.6.0 (97c98ec64a1fdfee7767ce5ffb20918da4f719f3; 2018-10-24T21:41:47+03:00)
lsb_release -a or cat /etc/*release*)mvn clean deploy VS mvn deploy:deploy)It works OK with JDK 12, but after upgrading to JDK 13 start to issue the error
Hello,
thank you for reporting your problem.
This sounds like https://github.com/git-commit-id/maven-git-commit-id-plugin/issues/446, but is more serious than I had expected. From my perspective and what I found online it sounded like a one-off issue (but after the second report it might not be the case).
In the linked issue setting <useNativeGit>true</useNativeGit> prevented this issue....however this is not a fix - this is rather a workaround. Could you confirm if this 'fixes' the issue?
I guess for now I'd prefer to keep this open and check with jgit if there is an issue reported for this....
using useNativeGit option eliminates the error
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
<version>3.0.1</version>
<configuration>
<useNativeGit>true</useNativeGit>
</configuration>
</plugin>
Well I'm not sure if this is a true fix to be honest.
In general the plugin allows to run with jgit (Java Git Implementation - default) or the native git binary (not default and enabled with <useNativeGit>true</useNativeGit>). So setting it to this setting essentially avoids jgit entirely (the stacktrace indicates the error when performing a specific jgit operation)
As mentioned in https://github.com/git-commit-id/maven-git-commit-id-plugin/issues/446#issuecomment-558179968 another way seems to be to specify <offline>true</offline> or as suggested in this issue <useNativeGit>true</useNativeGit>.
It also happened to me. Native git works while JGit throws auth exception.
C:\IDEA2019.3.3\jbr\bin\java.exe -Dmaven.multiModuleProjectDirectory=D:\projects\some\project -Dmaven.home=C:\IDEA2019.3.3\plugins\maven\lib\maven3 -Dclassworlds.conf=C:\IDEA2019.3.3\plugins\maven\lib\maven3\bin\m2.conf -Dmaven.ext.class.path=C:\IDEA2019.3.3\plugins\maven\lib\maven-event-listener.jar -javaagent:C:\IDEA2019.3.3\lib\idea_rt.jar=56506:C:\IDEA2019.3.3\bin -Dfile.encoding=UTF-8 -classpath C:\IDEA2019.3.3\plugins\maven\lib\maven3\boot\plexus-classworlds-2.6.0.jar org.codehaus.classworlds.Launcher -Didea.version2019.3.3 --version
Apache Maven 3.6.1 (d66c9c0b3152b2e69ee9bac180bb8fcc8e6af555; 2019-04-04T22:00:29+03:00)
Maven home: C:\IDEA2019.3.3\plugins\maven\lib\maven3
Java version: 11.0.5, vendor: JetBrains s.r.o, runtime: C:\IDEA2019.3.3\jbr
Default locale: en_US, platform encoding: UTF-8
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
Is this issue closed because it's tracked in #458?
@vadimkim
configuration fixed the problem for me.
BTW,
This error happened while building a spring-boot application using java 8.
Most helpful comment
Hello,
thank you for reporting your problem.
This sounds like https://github.com/git-commit-id/maven-git-commit-id-plugin/issues/446, but is more serious than I had expected. From my perspective and what I found online it sounded like a one-off issue (but after the second report it might not be the case).
In the linked issue setting
<useNativeGit>true</useNativeGit>prevented this issue....however this is not a fix - this is rather a workaround. Could you confirm if this 'fixes' the issue?I guess for now I'd prefer to keep this open and check with jgit if there is an issue reported for this....