Get project name (or key) in sonar


(Kad) #1

Hello everyone,

I’m running an analysis on several projects, and I want to only run the sonar rules on projects that have certain names patterns.

So my question is, giving an expression (MethodInvocation in my case), how can I get the project name that contains it ?

Thanks in advance.

(Tibor Blenessy) #2

Hello @kad,

I checked and it seems that we don’t expose this in the public API for custom plugins in SonarJava. However we can reconsider that if the use case is good. Can you elaborate bit more what is your intention? Can’t the same be achieved by simply associating the projects with quality profile tailored to them?