git打包出现错误:[ERROR] Failed to perform fetch
1、git打包出现如下错误:
[ERROR] Failed to perform fetch Failed to perform fetch org.eclipse.jgit.api.errors.TransportException: http://gitlab.cmvideo.cn/sales_ability/sales-center/agency.git: Authentication is required but no CredentialsProvider has been registered at org.eclipse.jgit.api.FetchCommand.call (FetchCommand.java:254) at pl.project13.maven.git.JGitProvider.fetch (JGitProvider.java:350) at pl.project13.maven.git.JGitProvider.getAheadBehind (JGitProvider.java:338) at pl.project13.maven.git.GitDataProvider.lambda$loadGitData$17 (GitDataProvider.java:168) at pl.project13.maven.git.GitDataProvider.lambda$memoize$23 (GitDataProvider.java:266) at pl.project13.maven.git.GitDataProvider.lambda$loadGitData$18 (GitDataProvider.java:169) at pl.project13.maven.git.GitDataProvider.maybePut (GitDataProvider.java:249) at pl.project13.maven.git.GitDataProvider.loadGitData (GitDataProvider.java:169) at pl.project13.maven.git.GitCommitIdMojo.loadGitDataWithJGit (GitCommitIdMojo.java:587) at pl.project13.maven.git.GitCommitIdMojo.loadGitData (GitCommitIdMojo.java:548) at pl.project13.maven.git.GitCommitIdMojo.execute (GitCommitIdMojo.java:443) 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 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:282) at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406) at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347) at org.codehaus.classworlds.Launcher.main (Launcher.java:47)
2、解决办法:
也许您可以通过以下方式找到解决方法:https://github.com/git-commit-id/git-commit-id-maven-plugin/issues/421
在 3.0.0 中,我们获得了两个新属性(git.local.branch.ahead / git.local.branch.behind),它们几乎只在使用 git pull before 时才正确。这个 git pull 可能会导致这样的传输异常(并且需要互联网)。
使用 3.0.1 会有更清晰的离线选项。真正的解决方法是我们让插件在离线模式下工作,除非指定。当用户在离线模式下操作并使用上述选项时,此插件会生成警告。
<build> <plugins> <plugin> <groupId>pl.project13.maven</groupId> <artifactId>git-commit-id-plugin</artifactId> <configuration> <offline>true</offline> </configuration> </plugin> </plugins> </build> 或者 <configuration> <excludeProperties> <excludeProperty>^git.local.branch.*$</excludeProperty> </excludeProperties> </configuration>
越努力,越幸运!