Sonarqube run is failing if .git does not exists in root directory

  • sonarqube Plugin version - 2.8

we are trying to run sonarqube using gradle and we do not have .git repo/directory in the root project path.

We are receiving below:
ERROR: Error during SonarQube Scanner execution
ERROR: Unable to open Git repository

what’s the solution or workaround ?

Hi,

Welcome to the community!

Could you provide the full, code-formatted (``` on the line before and on the line after) analysis log?

 
Ann

Please find the logs.

  • What went wrong:
    Execution failed for task ‘:test:test1:sonarqube’.
    > Unable to open Git repository

  • Try:
    Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Exception is:
    org.gradle.api.tasks.TaskExecutionException: Execution failed for task ‘:test:test1:sonarqube’.
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.lambda$executeIfValid$1(ExecuteActionsTaskExecuter.java:208)
    .
    .
    .
    .
    at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
    Caused by: java.lang.IllegalStateException: Unable to open Git repository
    .
    .
    .
    at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
    at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:41)
    Caused by: org.eclipse.jgit.errors.RepositoryNotFoundException: repository not found: F:\xx\xx\xx\xx\xx

Hi,

Instead of excerpting parts of the exception, could you provide the full analysis log, and apply code formatting (``` on the line before and on the line after) to that log?

 
Thx,
Ann