专栏首页光变Gradle Unable to blame file

Gradle Unable to blame file

背景

命令

gradle build sonarqube

错误信息

:sonarqube FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':sonarqube'.
> Unable to blame file src/main/java/xxxxxtMapper.java

* Try:
Run with --info or --debug option to get more log output.

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':sonarqube'.
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
	at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
	at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)
	at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
	at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:52)
	at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
	at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
	at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
	at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:203)
	at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:185)
	at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:66)
	at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:50)
	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
	at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
Caused by: java.lang.IllegalStateException: Unable to blame file src/main/java/xxxxxtMapper.java
	at org.sonar.plugins.scm.git.JGitBlameCommand.blame(JGitBlameCommand.java:128)
	at org.sonar.plugins.scm.git.JGitBlameCommand.access$000(JGitBlameCommand.java:45)
	at org.sonar.plugins.scm.git.JGitBlameCommand$1.call(JGitBlameCommand.java:113)
	at org.sonar.plugins.scm.git.JGitBlameCommand$1.call(JGitBlameCommand.java:110)
Caused by: java.lang.NullPointerException
	at org.eclipse.jgit.internal.storage.file.UnpackedObjectCache$Table.index(UnpackedObjectCache.java:146)
	at org.eclipse.jgit.internal.storage.file.UnpackedObjectCache$Table.contains(UnpackedObjectCache.java:109)
	at org.eclipse.jgit.internal.storage.file.UnpackedObjectCache.isUnpacked(UnpackedObjectCache.java:64)
	at org.eclipse.jgit.internal.storage.file.ObjectDirectory.openObject(ObjectDirectory.java:370)
	at org.eclipse.jgit.internal.storage.file.WindowCursor.open(WindowCursor.java:145)
	at org.eclipse.jgit.lib.ObjectReader.open(ObjectReader.java:229)
	at org.eclipse.jgit.blame.BlameGenerator.push(BlameGenerator.java:318)
	at org.eclipse.jgit.api.BlameCommand.call(BlameCommand.java:217)
	at org.sonar.plugins.scm.git.JGitBlameCommand.blame(JGitBlameCommand.java:123)
	... 3 more

解决方案

因为这是一个新的项目,没有commit过代码。 所以使用

git add . git commit . -m ‘初始化项目’

在执行上述的命令就没有问题了

gradle build sonarqube

也可以顺带push到远程环境

git remote add git:XXXXXX.git git push -u origin master

本文参与腾讯云自媒体分享计划,欢迎正在阅读的你也加入,一起分享。

我来说两句

0 条评论
登录 后参与评论

相关文章

  • Apache CollectionUtils使用指南

    对集合判定‘空’的操作使用Apache的commons-collection的工具包。

    白凡
  • Maven运行sonar出错

    Maven运行sonar报错 Unable to determine structure of project. Probably you use Maven ...

    白凡
  • SpringMVC 使用Valid注解校验数据

    白凡
  • spring-boot-starter-data-elasticsearch整合elasticsearch 6.x实现高亮

    其中elasticRepository.search(searchQuery)方法是ElasticsearchRepository接口(本文中ElasticSe...

    程裕强
  • org.springframework.data.redis.serializer.SerializationException: Cannot serialize;

    前言 本文中提到的解决方案,源码地址在:perfect-ssm,希望可以帮你解决问题。 问题描述 在Spring与Redis整合过程中,出现了如下报错: ...

    我是十三
  • java.lang.IllegalArgumentException: node to traverse cannot be null!

    java.lang.IllegalArgumentException: node to traverse cannot be null!

    时间静止不是简史
  • 由一次线上故障来理解下TCP三握、四挥 & Java堆栈分析到源码的探秘

    该服务主要是提供对外的代理接口,大部分接口都会调用第三方接口,获取数据后做聚合处理后,提供给客户端使用。

    云爬虫技术研究笔记
  • 由一次线上故障来理解下TCP三握、四挥; Java堆栈分析到源码的探秘

    该服务主要是提供对外的代理接口,大部分接口都会调用第三方接口,获取数据后做聚合处理后,提供给客户端使用。

    黄泽杰
  • ABAP和Java SpringBoot的单元测试

    在ABAP类里,本地类(Local Class)里用关键字FOR TESTING声明过的方法,

    Jerry Wang
  • ABAP和Java SpringBoot的单元测试

    在ABAP类里,本地类(Local Class)里用关键字FOR TESTING声明过的方法,

    Jerry Wang

扫码关注云+社区

领取腾讯云代金券