IntelliJ: per-module linking to different SonarQube projects

1,097 views
Skip to first unread message

Thierry Monney

unread,
Jan 12, 2017, 2:34:02 AM1/12/17
to SonarLint
Hi group,

I am using the IntelliJ SonarLint plugin in connected mode and it works great so far.

What I am currently missing is the possibility to link individual IntelliJ modules to different SonarQube projects. The current settings only allow to set the SonarQube project at the IntelliJ project level (Settings -> Other Settings -> SonarLint Project Settings). It would be nice to be able to assign a different SonarQube project to each individual module. A similar configuration possibility exists for Annotation Processors for example (Settings -> Build, Execution, Deployment -> Compiler -> Annotation Processors) where on can configure annotation processing per-module.

Does that make sense?

Cheers
Thierry

duarte.meneses

unread,
Jan 12, 2017, 8:30:06 AM1/12/17
to SonarLint
Hi Thierry,

It does make sense. We offer that possibility in SonarLint Eclipse, for example, but that's because every module of the project is actually a project in Eclipse. For IntelliJ, devs usually import the entire project (and modules are handled as so), and SonarLint tries then to automatically map each module in IntelliJ with each module in SonarQube. Therefore, we considered that for the vast majority of the cases it's simpler to bind the top level IntelliJ project with the top level SonarQube project.

What is exactly your case, do you have a project imported in IntelliJ with a structure different than the one in SonarQube?

Mark Gortzak

unread,
Jan 13, 2017, 3:39:26 AM1/13/17
to SonarLint
We actually have the same issue.

We have Gradle multi-project:
base.prj
=> h3_generator.prj
=> h3_lib_core.prj
=> h3_lib_service.prj

In IntelliJ we have a ipr file for main.prj, and seperate iml files for sub1.prj, sub2.prj and sub3.prj. When we start IntelliJ you see something like this:
 If I want to use SonarLint in connected mode for the seperate modules I need to switch each and everytime. Which isn't that much of a hassle, you can easily get to SonarLint settings. But being able to configure that certain IntelliJ modules use specific SonarQube projects would be great :).

Thierry Monney

unread,
Jan 16, 2017, 3:33:09 AM1/16/17
to SonarLint
Hi,

Our us case is as follows:

We have multiple separate but related Maven projects, each with its own Git repository, Jenkins builds, SonarQube project, etc. Something like:
  - my-app-api
    - child-module1
    - child-module2
  - my-app-online
    - child-module1
    - child-module2
  - my-app-batch
    - child-module1
    - child-module2
  - some-other-related-project
    - child-module1
    - child-module2

On the SonarQube side, we have the following projects:
- my-app-api
- my-app-online
- my-app-batch
- some-other-related-project
- ... and many others of course

We import all root modules in the same IntelliJ project. Now we would like to map each root module to the corresponding SonarQube project.

Does that still make sense?

Cheers
Thierry

duarte.meneses

unread,
Jan 17, 2017, 3:34:38 AM1/17/17
to SonarLint
Thanks for the explanation.
I've created a ticket: https://jira.sonarsource.com/browse/SLI-171.
We might be able to schedule it for one of the upcoming versions.

Mark Gortzak

unread,
Jan 17, 2017, 3:40:17 AM1/17/17
to SonarLint
Thanks! Looking forwards to it.

Op dinsdag 17 januari 2017 09:34:38 UTC+1 schreef duarte.meneses:

Thierry Monney

unread,
Jan 17, 2017, 11:02:29 AM1/17/17
to Mark Gortzak, SonarLint

Cool, thanks!


--
You received this message because you are subscribed to the Google Groups "SonarLint" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarlint+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarlint/a843edd4-0d62-4229-a6cb-69bd1e2e99cd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

fabian....@googlemail.com

unread,
May 12, 2017, 11:09:50 AM5/12/17
to SonarLint
Any news on this? We could use this feature, too.

Julien HENRY

unread,
May 29, 2017, 4:16:01 AM5/29/17
to fabian....@googlemail.com, SonarLint

2017-05-12 17:09 GMT+02:00 fabian.koentopp via SonarLint <sona...@googlegroups.com>:
Any news on this? We could use this feature, too.

Nothing planned yet, but don't hesitate to vote for the ticket.

Julien Henry | SonarSource

Developer

http://sonarsource.com

Reply all
Reply to author
Forward
0 new messages