# Sonarcloud java files analysis

**URL:** <https://community.sonarsource.com/t/sonarcloud-java-files-analysis/102953>\
**Category:** SonarQube Cloud\
**Created:** [October 20, 2023, 4:04am UTC](https://community.sonarsource.com/t/sonarcloud-java-files-analysis/102953 "2023-10-20T04:04:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ahmad\_Azab](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ahmad_azab/32/45742_2.png) [@Ahmad\_Azab](https://community.sonarsource.com/u/Ahmad_Azab)\
**Post date:** [October 20, 2023, 4:04am UTC](https://community.sonarsource.com/t/sonarcloud-java-files-analysis/102953/1 "2023-10-20T04:04:21Z")

</div>

Hello all,

I have followed the process illustrated in the link: [https://azuredevopslabs.com/labs/vstsextend/sonarcloud/](https://azuredevopslabs.com/labs/vstsextend/sonarcloud/) to integrate sonarcloud with azure DevOps and successfully analysed the Repo found in: [https://github.com/SonarSource/sonar-scanning-examples.git](https://github.com/SonarSource/sonar-scanning-examples.git). The reults were mainly C# codes.  
Later, I tried to analyse another code with Repo filled with security vulnerabilities in Java and other languages: [https://github.com/SonarSource/sonar-training-examples.git](https://github.com/SonarSource/sonar-training-examples.git) but the analyses results only returned C# code smells! Am I missing something? Why only C# being analysed?

---

<div class="post-metadata">

**Author:** ![Colin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/colin/32/55255_2.png) [@Colin](https://community.sonarsource.com/u/Colin)\
**Post date:** [October 23, 2023, 8:20am UTC](https://community.sonarsource.com/t/sonarcloud-java-files-analysis/102953/2 "2023-10-23T08:20:57Z")

</div>

Hey there.

How did you configure your Azure Pipelines YML? Feel free to share it here.

---

<div class="post-metadata">

**Author:** ![Ahmad\_Azab](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ahmad_azab/32/45742_2.png) [@Ahmad\_Azab](https://community.sonarsource.com/u/Ahmad_Azab)\
**Post date:** [October 23, 2023, 9:34am UTC](https://community.sonarsource.com/t/sonarcloud-java-files-analysis/102953/3 "2023-10-23T09:34:39Z")

</div>

Hello Colin,

Kindly find below. Please note that I tried both Azure agent and a local agent on my laptop but no luck.

```auto
trigger:
- master

pool:
  vmImage: ubuntu-latest

steps:
- checkout: self
  fetchDepth: 0

- task: SonarCloudPrepare@1
  inputs:
    SonarCloud: *******
    organization: *******
    scannerMode: 'Other'
    extraProperties: |
      # Additional properties that will be passed to the scanner,
      # Put one key=value per line, example:
      # sonar.exclusions=**/*.bin
      sonar.projectKey= ********
      sonar.projectName=Specific

- task: Gradle@2
  inputs:
    gradleWrapperFile: 'gradlew'
    tasks: 'build'
    publishJUnitResults: true
    testResultsFiles: '**/TEST-*.xml'
    codeCoverageToolOption: 'Cobertura'
    codeCoverageClassFilesDirectories: 'build/classes/main/'
    javaHomeOption: 'JDKVersion'
    jdkVersionOption: '1.8'
    gradleOptions: '-Xmx3072m'
    sonarQubeRunAnalysis: true
    sqGradlePluginVersionChoice: 'build'
    spotBugsAnalysis: false

- task: SonarCloudPublish@1
  inputs:
    pollingTimeoutSec: '300'

```

---

<div class="post-metadata">

**Author:** ![Colin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/colin/32/55255_2.png) [@Colin](https://community.sonarsource.com/u/Colin)\
**Post date:** [October 23, 2023, 9:48am UTC](https://community.sonarsource.com/t/sonarcloud-java-files-analysis/102953/4 "2023-10-23T09:48:13Z")

</div>

It would be very surprising to see C# files analyzed in that case, as you aren’t using the Scanner for .NET.

Can you share the pipeline logs with `--info` appended to the Gradle command? I have a feeling you have a successful analysis already targeted at that project key, but the analysis you think you’re performing is never actually getting to SonarCloud.
