Broker sonar cloud task failing

Used following task:

  - task: Maven@3
    displayName: Broker Sonar Code Analysis 
    inputs:
      mavenPomFile: 'pom.xml'
      goals: 'verify sonar:sonar'
      publishJUnitResults: true
      testResultsFiles: '**/surefire-reports/TEST-*.xml'
      javaHomeOption: 'JDKVersion'
      jdkVersionOption: '1.17'
      mavenVersionOption: 'Default'
      mavenAuthenticateFeed: false
      effectivePomSkip: false
      sonarQubeRunAnalysis: false

and I am seeing error logs as below :slight_smile:

07:49:54.395 [main] ERROR com.domain.ris.ssa.brokerservices.service.api.external.mis.MisMfaVerifyApiService -- org.springframework.web.client.RestClientException: Rest client exception
	at org.springframework.web.client.RestTemplate.postForEntity(RestTemplate.java:536)
	at com.metlife.ris.ssa.brokerservices.service.api.external.mis.MisMfaVerifyApiService.verifyMFA(MisMfaVerifyApiService.java:69)
	at com.metlife.ris.ssa.brokerservices.service.api.external.mis.MisMfaVerifyApiServiceTest.testVerifyMFA_RestClientException(MisMfaVerifyApiServiceTest.java:92)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:728)
	at org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:131)
	at org.junit.jupiter.engine.extension.TimeoutExtension.intercept(TimeoutExtension.java:156)
	at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(TimeoutExtension.java:1

Hey there!

I don’t see any references to Sonar or SonarQube-related errors in the stacktrace provided. The errors appear to be related to your application’s test cases (specifically, a RestClientException in your MisMfaVerifyApiService unit test).

It looks like your build or tests are failing, which could be causing issues with your pipeline. I would recommend investigating the test failures in your code first—it’s possible that fixing those will resolve your pipeline problems.