Domanda

I have many(Let say 10 (A, B, C...)) eclipse plugin which is maven based.

I have one master pom file which includes all other plugin projects. now by building master file with sonar:sonar goal it will build all the plugins.

So my question: Is there is any way so that I can exclude some plugin let say A and C.?

È stato utile?

Soluzione 2

NOTE: This property is deprecated since version 4.3 and should not be used anymore.

From the documentation, there is an option to skip module using sonar.skippedModules

You could also do this from the sonar admin page as documented in the Skipping Modules section here.

Altri suggerimenti

There are several ways, one of which is adding the sonar.skip property inside the pom.xml of the project / module you want to skip.

This excludes a project from SonarQube analysis:

<properties>
    <sonar.skip>true</sonar.skip>
</properties>

This also works with Jenkins and running Sonar as a post build action.

For more details see: Analyzing with SonarQube Scanner for Maven

I had no luck with the officially documented sonar.skip: when I set it in a submodule POM, I saw

[INFO] Delaying SonarQube Scanner to the end of multi-module project

after modules which should have been included and then

[INFO] sonar.skip = true: Skipping analysis

at the end of the reactor build, and there was no analysis/upload.

Instead I defined sonar.exclusions in the root POM to a pattern matching the source files (by package path) which would be used in the submodule to be skipped. This seems to have worked.


As an aside, setting sonar.projectKey in the root POM did not work; Sonar complained that

Project '…' can't have 2 modules with the following key: …

which I fixed by moving this to .mvn/maven.config:

-Dsonar.projectKey=…
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top