Maven Advanced Reactor Options with a broken tree of modules

java
maven
jenkins
sonarqube

(Thomas Lowery) #1

Greeting All,
After recently upgrading to sonarqube 5.6.7 then 6.7.4 we frequently experience jenkins build failures with this error:

Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.4.1.1168:sonar (default-cli) on project MyProject: Unable to determine structure of project. Probably you use Maven Advanced Reactor Options with a broken tree of modules. “MyProject:Module” is orphan -> [Help 1]

Running the build again is normally successful, worst case running the build a 3rd time succeeds.

sonarqube Version 6.7.4 (build 38452) - LGPL v3 - Community
sonar-maven-plugin:3.4.1.1168
maven goals clean install sonar:sonar
Jenkins ver. 2.121.1
Apache Maven 3.5.3
Red Hat Enterprise Linux Server release 6.6 (Santiago)


(Julien Henry) #3

Hi Thomas,

This message come from the Maven plugin (sonar-maven-plugin). I highly doubt it has any relationship with the SonarQube server version.

The fact the problem is intermittent is really surprising.

Are you using a fixed version of the Maven plugin (locked in your pom) ? Or do you rely on latest release (mvn sonar:sonar).

On Jenkins, are you using a freestyle job, or a Maven job type? I remember Jenkins Maven job type was sometimes trying to do black magic (like only building changed modules).


(Thomas Lowery) #4

Thanks for replying Julien!

Relying on the latest release (mvn sonar:sonar). Command is mvn clean install sonar:sonar
Maven job.

The intermittent does make it odd, which provides a work around in a way.

Should I attempt to lock the plugin version?


(Julien Henry) #5

Should I attempt to lock the plugin version?

You can give it a try. If you don’t want to change all your pom.xml, just change your CI configuration to run mvn org.sonarsource.scanner.maven:sonar-maven-plugin:3.4.1.1168:sonar. It would be a very good news if it make the behavior consistent (either always failing or passing).