I have included sonar:sonar goal with Maven build for our multi module maven project. The build fails with error for projects that does not have a Java class:
Failed to execute goal org.codehaus.sonar:sonar-maven3-plugin:3.3:sonar (sonar) on project PROJECT: Execution sonar of goal org.codehaus.sonar:sonar-maven3-plugin:3.3:sonar failed: Not a root project: org.sonar.api.batch.bootstrap.ProjectDefinition
Is there a way to exclude projects from sonar goal execution? Also is there a way to ignore sonar related errors in the build?
When sonar execution is run on the parent project, all the child modules get reviewed, hence there is no need to put inherited this goal on child modules – setting inherited as false for the maven plugin solved the issue for me.