Gradle sonar scanner azure pipeline

Template for a good bug report, formatted with Markdown:

  • versions used (SonarQube, Scanner, Plugin, and any relevant extension): Sonar Scanner plugin 3.3
  • error observed (wrap logs/code around triple quote ``` for proper formatting): Analysis is not visible on server
  • steps to reproduce:
022-02-17T12:16:04.5600670Z ##[section]Starting: GradleSonarGsep
2022-02-17T12:16:04.5607184Z ==============================================================================
2022-02-17T12:16:04.5607466Z Task         : Bash
2022-02-17T12:16:04.5607718Z Description  : Run a Bash script on macOS, Linux, or Windows
2022-02-17T12:16:04.5607981Z Version      : 3.198.0
2022-02-17T12:16:04.5608183Z Author       : Microsoft Corporation
2022-02-17T12:16:04.5608503Z Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/bash
2022-02-17T12:16:04.5608884Z ==============================================================================
2022-02-17T12:16:04.7090202Z Generating script.
2022-02-17T12:16:04.7127504Z ========================== Starting Command Output ===========================
2022-02-17T12:16:04.7148535Z [command]/usr/bin/bash /home/vsts/work/_temp/fdc92edf-6edc-499a-9e31-f0a80836eeb4.sh
2022-02-17T12:16:04.9689005Z keytool error: java.security.KeyStoreException: Unrecognized keystore format. Please load it with a specified type
2022-02-17T12:16:05.8735936Z Starting a Gradle Daemon, 1 stopped Daemon could not be reused, use --status for details
2022-02-17T12:16:11.4743639Z > Task :processResources UP-TO-DATE
2022-02-17T12:16:18.1731733Z > Task :compileJava UP-TO-DATE
2022-02-17T12:16:18.1732390Z > Task :classes UP-TO-DATE
2022-02-17T12:16:19.8729377Z > Task :compileTestJava UP-TO-DATE
2022-02-17T12:16:49.8729250Z > Task :sonarqube
2022-02-17T12:16:51.6735775Z Unresolved imports/types have been detected during analysis. Enable DEBUG mode to see them.
2022-02-17T12:16:53.8755596Z Invalid character encountered in file /home/vsts/work/1/s/src/test/java/com/daimler/offstreet/notification/service/AvpServiceTest.java at line 75 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
2022-02-17T12:16:54.3729796Z Unresolved imports/types have been detected during analysis. Enable DEBUG mode to see them.
2022-02-17T12:16:54.3731541Z Reports path not found or is not a directory: /home/vsts/work/1/s/build/test-results/integrationTest
2022-02-17T12:17:14.5755639Z 
2022-02-17T12:17:14.5757379Z The following classes needed for analysis were missing:
2022-02-17T12:17:14.5758047Z   org.apache.http.ssl.TrustStrategy
2022-02-17T12:17:14.5758709Z   org.springframework.web.servlet.config.annotation.WebMvcConfigurer
2022-02-17T12:17:14.5759444Z   org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter
2022-02-17T12:17:14.5760572Z   org.springframework.web.servlet.handler.HandlerInterceptorAdapter
2022-02-17T12:17:14.5761407Z   com.daimler.onstreet.commons.rest.properties.ConnectorProperties
2022-02-17T12:17:14.5762004Z   brave.propagation.Propagation
2022-02-17T12:17:14.5762733Z   brave.propagation.Propagation$Factory
2022-02-17T12:17:14.5763493Z   brave.propagation.TraceContext$Extractor
2022-02-17T12:17:14.5764097Z   brave.propagation.TraceContext$Injector
2022-02-17T12:17:14.5764909Z   javax.servlet.Filter
2022-02-17T12:17:14.5765466Z   brave.propagation.Propagation$Getter
2022-02-17T12:17:14.5766112Z   org.springframework.web.filter.GenericFilterBean
2022-02-17T12:17:14.5766934Z   org.springframework.http.client.ClientHttpRequestInterceptor
2022-02-17T12:17:14.5768089Z   org.springframework.core.ParameterizedTypeReference
2022-02-17T12:17:14.5768868Z   com.daimler.onstreet.commons.logging.OnStreetLogger
2022-02-17T12:17:14.5769501Z   org.springframework.web.bind.MissingServletRequestParameterException
2022-02-17T12:17:14.5770149Z   org.springframework.web.bind.MethodArgumentNotValidException
2022-02-17T12:17:14.5770796Z   org.springframework.http.converter.HttpMessageNotReadableException
2022-02-17T12:17:14.5771428Z   org.springframework.validation.BindingResult
2022-02-17T12:17:14.5772013Z   org.springframework.boot.SpringApplication
2022-02-17T12:17:14.5772753Z   org.springframework.data.redis.core.RedisTemplate
2022-02-17T12:17:14.5773521Z   com.fasterxml.jackson.databind.ObjectMapper
2022-02-17T12:17:14.5774151Z   org.springframework.data.redis.core.HashOperations
2022-02-17T12:17:14.5775017Z   org.springframework.util.StringUtils
2022-02-17T12:17:14.5775605Z   org.springframework.web.client.HttpServerErrorException
2022-02-17T12:17:14.5776213Z   org.springframework.web.client.HttpClientErrorException
2022-02-17T12:17:14.5776823Z   org.springframework.web.client.ResourceAccessException
2022-02-17T12:17:14.5777367Z   com.google.gson.Gson
2022-02-17T12:17:14.5777851Z   org.joda.time.DateTimeZone
2022-02-17T12:17:14.5778373Z   org.joda.time.ReadableInstant
2022-02-17T12:17:14.5778876Z   org.joda.time.DateTime
2022-02-17T12:17:14.5779391Z   org.joda.time.format.DateTimeFormat
2022-02-17T12:17:14.5779932Z   org.joda.time.format.DateTimeFormatter
2022-02-17T12:17:14.5780545Z   org.springframework.validation.beanvalidation.MethodValidationPostProcessor
2022-02-17T12:17:14.5781988Z   org.springframework.http.HttpStatus
2022-02-17T12:17:14.5782546Z   org.springframework.web.client.RestTemplate
2022-02-17T12:17:14.5783036Z   org.apache.commons.codec.digest.DigestUtils
2022-02-17T12:17:14.5783527Z   org.springframework.http.ResponseEntity
2022-02-17T12:17:14.5783988Z   org.springframework.util.MultiValueMap
2022-02-17T12:17:14.5784421Z   org.springframework.http.HttpMethod
2022-02-17T12:17:14.5784866Z   org.springframework.http.HttpEntity
2022-02-17T12:17:14.5785313Z   org.springframework.http.HttpHeaders
2022-02-17T12:17:14.5785842Z   org.springframework.web.servlet.HandlerInterceptor
2022-02-17T12:17:14.5786464Z   org.springframework.web.servlet.config.annotation.InterceptorRegistry
2022-02-17T12:17:14.5787108Z   org.springframework.web.servlet.config.annotation.InterceptorRegistration
2022-02-17T12:17:14.5787680Z   com.fasterxml.jackson.databind.JsonNode
2022-02-17T12:17:14.5788212Z   javax.validation.ConstraintViolationException
2022-02-17T12:17:14.5788815Z   org.springframework.web.method.annotation.MethodArgumentTypeMismatchException
2022-02-17T12:17:14.5789401Z   javax.validation.ConstraintViolation
2022-02-17T12:17:14.5789920Z   org.joda.time.format.ISODateTimeFormat
2022-02-17T12:17:14.5790441Z   javax.servlet.http.HttpServletRequest
2022-02-17T12:17:14.5790927Z   javax.servlet.http.HttpServletResponse
2022-02-17T12:17:14.5791385Z   brave.Tracer
2022-02-17T12:17:14.5791822Z   javax.servlet.ServletRequest
2022-02-17T12:17:14.5792294Z   javax.servlet.ServletResponse
2022-02-17T12:17:14.5792779Z   javax.servlet.FilterChain
2022-02-17T12:17:14.5793382Z   brave.Span
2022-02-17T12:17:14.5793781Z   brave.propagation.TraceContext
2022-02-17T12:17:14.5794444Z   org.apache.http.client.config.RequestConfig
2022-02-17T12:17:14.5794925Z   org.apache.http.client.HttpClient
2022-02-17T12:17:14.5795422Z   org.springframework.http.client.ClientHttpRequestFactory
2022-02-17T12:17:14.5795913Z   org.apache.http.config.Registry
2022-02-17T12:17:14.5796392Z   org.apache.http.conn.HttpClientConnectionManager
2022-02-17T12:17:14.5797033Z   org.apache.http.impl.client.HttpClientBuilder
2022-02-17T12:17:14.5797718Z   com.daimler.onstreet.commons.rest.CustomRestTemplateBuilder
2022-02-17T12:17:14.5798626Z   org.apache.http.impl.client.HttpClients
2022-02-17T12:17:14.5799772Z   org.apache.http.client.config.RequestConfig$Builder
2022-02-17T12:17:14.5800729Z   org.apache.http.ssl.SSLContextBuilder
2022-02-17T12:17:14.5801441Z   org.springframework.http.client.HttpComponentsClientHttpRequestFactory
2022-02-17T12:17:14.5802397Z   org.apache.http.conn.ssl.SSLConnectionSocketFactory
2022-02-17T12:17:14.5803231Z   org.apache.http.config.RegistryBuilder
2022-02-17T12:17:14.5803745Z   org.apache.http.conn.socket.PlainConnectionSocketFactory
2022-02-17T12:17:14.5804290Z   org.apache.http.impl.conn.PoolingHttpClientConnectionManager
2022-02-17T12:17:14.5804992Z   org.springframework.core.io.ResourceLoader
2022-02-17T12:17:14.5805479Z   org.springframework.core.io.Resource
2022-02-17T12:17:14.5805991Z   brave.propagation.Propagation$KeyFactory
2022-02-17T12:17:14.5806462Z   brave.propagation.Propagation$Setter
2022-02-17T12:17:14.5807094Z   springfox.documentation.spi.DocumentationType
2022-02-17T12:17:14.5807773Z   com.google.common.base.Predicate
2022-02-17T12:17:14.5808383Z   springfox.documentation.service.ApiInfo
2022-02-17T12:17:14.5808863Z   com.fasterxml.classmate.TypeResolver
2022-02-17T12:17:14.5809321Z   springfox.documentation.spring.web.plugins.Docket
2022-02-17T12:17:14.5809830Z   springfox.documentation.builders.RequestHandlerSelectors
2022-02-17T12:17:14.5810360Z   springfox.documentation.spring.web.plugins.ApiSelectorBuilder
2022-02-17T12:17:14.5810862Z   springfox.documentation.builders.PathSelectors
2022-02-17T12:17:14.5811471Z   springfox.documentation.schema.AlternateTypeRules
2022-02-17T12:17:14.5811957Z   springfox.documentation.builders.ApiInfoBuilder
2022-02-17T12:17:14.5812465Z   org.springframework.core.io.ClassPathResource
2022-02-17T12:17:14.5813771Z   org.joda.time.DateTimeComparator
2022-02-17T12:17:14.5814295Z   org.apache.commons.codec.binary.Base64
2022-02-17T12:17:14.5815124Z   com.azure.messaging.eventhubs.EventData
2022-02-17T12:17:14.5815674Z   com.azure.messaging.eventhubs.EventHubClientBuilder
2022-02-17T12:17:14.6732106Z   com.azure.messaging.eventhubs.EventHubProducerClient
2022-02-17T12:17:14.6733529Z   com.azure.messaging.eventhubs.EventDataBatch
2022-02-17T12:17:14.6734301Z   org.springframework.http.HttpRequest
2022-02-17T12:17:14.6735041Z   org.springframework.http.client.ClientHttpRequestExecution
2022-02-17T12:17:14.6736264Z   org.springframework.web.context.request.RequestContextHolder
2022-02-17T12:17:14.6736982Z   org.springframework.web.context.request.ServletRequestAttributes
2022-02-17T12:17:14.6743808Z   org.slf4j.Logger
2022-02-17T12:17:14.6744502Z   com.fasterxml.jackson.core.JsonProcessingException
2022-02-17T12:17:14.6745093Z   org.slf4j.LoggerFactory
2022-02-17T12:17:14.6745717Z   org.springframework.security.config.annotation.web.builders.HttpSecurity
2022-02-17T12:17:14.6746455Z   org.springframework.security.config.annotation.web.configurers.HeadersConfigurer
2022-02-17T12:17:14.6747215Z   org.springframework.security.config.annotation.web.configurers.HeadersConfigurer$HstsConfig
2022-02-17T12:17:14.6748031Z   org.springframework.security.config.annotation.web.configurers.HeadersConfigurer$FrameOptionsConfig
2022-02-17T12:17:14.6748815Z   org.springframework.security.config.annotation.web.configurers.HeadersConfigurer$XXssConfig
2022-02-17T12:17:14.6749563Z   org.springframework.security.config.annotation.web.configurers.CsrfConfigurer
2022-02-17T12:17:14.6750947Z   brave.Tracing
2022-02-17T12:17:14.6751936Z   brave.http.HttpTracing
2022-02-17T12:17:14.6752506Z   brave.http.HttpServerAdapter
2022-02-17T12:17:14.6753311Z   javax.servlet.FilterConfig
2022-02-17T12:17:14.6753872Z   brave.Tracing$Builder
2022-02-17T12:17:14.6754413Z   brave.http.HttpServerHandler
2022-02-17T12:17:14.6754989Z   brave.propagation.CurrentTraceContext
2022-02-17T12:17:14.6755596Z   brave.propagation.CurrentTraceContext$Scope
2022-02-17T12:17:14.6756190Z   brave.servlet.HttpServletAdapter
2022-02-17T12:17:14.6758487Z   org.springframework.web.util.UriComponentsBuilder
2022-02-17T12:17:14.6759506Z   org.springframework.web.util.UriComponents
2022-02-17T12:17:14.6760214Z   org.springframework.http.MediaType
2022-02-17T12:17:14.6760933Z   org.springframework.web.client.HttpStatusCodeException
2022-02-17T12:17:14.6761681Z   org.springframework.web.client.RestClientException
2022-02-17T12:17:14.6763566Z   com.fasterxml.jackson.annotation.JsonInclude$Include
2022-02-17T12:17:14.6764736Z   org.springframework.http.converter.json.Jackson2ObjectMapperBuilder
2022-02-17T12:17:14.6765562Z   org.springframework.util.ObjectUtils
2022-02-17T12:17:14.6766082Z   redis.clients.jedis.JedisPoolConfig
2022-02-17T12:17:14.6766651Z   org.springframework.boot.autoconfigure.data.redis.RedisProperties
2022-02-17T12:17:14.6767279Z   org.springframework.data.redis.connection.jedis.JedisConnectionFactory
2022-02-17T12:17:14.6767921Z   org.springframework.data.redis.serializer.GenericToStringSerializer
2022-02-17T12:17:14.6768690Z   org.springframework.data.redis.serializer.StringRedisSerializer
2022-02-17T12:17:14.6769467Z   org.joda.time.Minutes
2022-02-17T12:17:14.6769949Z   org.springframework.util.CollectionUtils
2022-02-17T12:17:14.6770446Z   brave.propagation.TraceIdContext
2022-02-17T12:17:14.6771111Z   brave.propagation.TraceContextOrSamplingFlags
2022-02-17T12:17:14.6771650Z   brave.propagation.TraceIdContext$Builder
2022-02-17T12:17:14.6772378Z   com.fasterxml.jackson.annotation.JsonInclude
2022-02-17T12:17:14.6773144Z   org.springframework.web.context.request.RequestAttributes
2022-02-17T12:17:14.6774439Z   org.springframework.security.config.annotation.web.configurers.HeadersConfigurer$ContentTypeOptionsConfig
2022-02-17T12:17:14.6775311Z   javax.servlet.ServletException
2022-02-17T12:17:14.6775829Z   brave.SpanCustomizer
2022-02-17T12:17:14.6776535Z   org.springframework.data.redis.connection.RedisConnectionFactory
2022-02-17T12:17:14.6777308Z   org.springframework.data.redis.serializer.RedisSerializer
2022-02-17T12:17:14.6778028Z   springfox.documentation.schema.AlternateTypeRule
2022-02-17T12:17:14.6778588Z   org.springframework.web.context.request.async.DeferredResult
2022-02-17T12:17:14.6779124Z   springfox.documentation.schema.WildcardType
2022-02-17T12:17:14.6779555Z   test
2022-02-17T12:17:14.6779904Z   accept
2022-02-17T12:17:14.6780514Z   apply
2022-02-17T12:17:14.6780919Z   org.springframework.context.support.DefaultMessageSourceResolvable
2022-02-17T12:17:14.6781133Z 
2022-02-17T12:17:14.6781468Z > Task :sonarqube
2022-02-17T12:17:14.6885280Z Path to PVS-Studio report wasn't specified, use the following key: 'sonar.pvs-studio.reportPath'
2022-02-17T12:17:15.8729033Z 
2022-02-17T12:17:15.8730595Z Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
2022-02-17T12:17:15.8732607Z Use '--warning-mode all' to show the individual deprecation warnings.
2022-02-17T12:17:15.8734218Z See https://docs.gradle.org/6.4.1/userguide/command_line_interface.html#sec:command_line_warnings
2022-02-17T12:17:15.8734524Z 
2022-02-17T12:17:15.8734824Z BUILD SUCCESSFUL in 1m 10s
2022-02-17T12:17:15.8735458Z 4 actionable tasks: 1 executed, 3 up-to-date
2022-02-17T12:17:16.2622730Z ##[section]Finishing: GradleSonarGsep
  • potential workaround

P.S.: use the #bug:fault sub-category if you’re hitting a specific crash/error , or the #bug:fp sub-category for rules-related behaviour

I have integrated sonarscanner for gradle project using azure pipeline, scan is getting succeeded but scan is not being displayed

Hi,
Could you please run the scan with -d so that we can get the debug logs from the sonarqube task?