Sonar Maven plugin failing, says two modules have the same name

  • ALM used: GitHub
  • CI system used: Circle CI
  • Scanner command used when applicable (private details masked)
  • Languages of the repository: java
  • Error observed:
    [ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar (default-cli) on project jpo-ode: Unable to load component class org.sonar.scanner.scan.ProjectLock: Unable to load component class org.sonar.api.batch.fs.internal.DefaultInputProject: Unable to load component class org.sonar.api.batch.bootstrap.ProjectReactor: Project ‘usdot-jpo-ode_jpo-ode’ can’t have 2 modules with the following key: usdot-jpo-ode_jpo-ode -> [Help 1]
    org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar (default-cli) on project jpo-ode: Unable to load component class org.sonar.scanner.scan.ProjectLock

Here is a link to the repo. I understand that maven populates module names as <groupId>:<artifactId>, however searching through this project I don’t see anywhere that would be causing the duplication. Any pointers on this would be much appreciated.

Are you trying to override the project’s key with a command line argument?

I don’t think so. The only command i’m running in my circle config is: mvn -e -X clean org.jacoco:jacoco-maven-plugin:prepare-agent package sonar:sonar

I’m not able to reproduce the problem with that repo. Could you share your scanner logs?

Yeah, the log is right here.

It looks like the sonar.projectKey property is being set:

[DEBUG] properties used {spring-batch.version=3.0.7.RELEASE, env.OLDPWD=/home/circleci/project, file.encoding.pkg=sun.io, undertow.version=1.3.25.Final, httpclient.version=4.5.2, webjars-locator.version=0.32, java.home=/usr/local/openjdk-8/jre, sonar.projectKey=usdot-jpo-ode_jpo-ode
1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.