[INFO] 1 file indexed -> Not Pulling The Full Project

This is a setup with SonarCloud and Gitlab
I think i have a problem with my pom file. The pom file is the only thing importing.

here is the pom, does anything look off?

<project xmlns="http://maven.apache.org/POM/4.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
                      http://maven.apache.org/xsd/maven-4.0.0.xsd">

        <groupId>group id is here</groupId>
  <modelVersion>4.0.0</modelVersion>
  <artifactId>artifact name here</artifactId>
  <version>1.0.0</version>
 
 <build>
    <plugins>
     <plugin>
      <groupId>org.sonarsource.scanner.maven</groupId>
      <artifactId>sonar-maven-plugin</artifactId>
      <version>3.3.0.603</version>
      <executions>
      <execution>
      <phase>verify</phase>
      <goals>
      <goal>sonar</goal>
      </goals>
      </execution>
      </executions>
     </plugin>
    </plugins>
  </build>



   <properties>                   
  <sonar.projectKey>project key here</sonar.projectKey>
  <sonar.organization>org here-1</sonar.organization>
     <sonar.host.url>https://sonarcloud.io</sonar.host.url>
  <sonar.login>login key here</sonar.login>
     
  </properties>


</project>

Any support on here?

Thank you

Welcome to the Community!

Do you mean that when the project is analyzed, you only see the pom.xml file when you browse the Code tab on SonarCloud UI? Please clarify!

Please also clarify the following:

  • How do you run the scanner?
  • Are you experiencing this when analyzing the master branch, or is it a pull request analysis or short-living branch analysis?

As a side note, and not related to your issue, but you should not add <sonar.login> in your pom.xml, because such sensitive credentials should not be under version control. There are better ways to pass this, for example using the SONAR_TOKEN environment variable, or -Dsonar.login=... command line argument.

1 Like