简体   繁体   中英

How to get Maven multi-module project with separate Sonar project per module?

Direct question:

I need to get Maven multi-module project integrated with Sonar where each module will have separate Sonar project. Any working example how to achieve this? Maven version is 3.0.4 if it matters.

Somewhat more detailed explanation why

Yes, I have 100% working multi-module project which maps to single Sonar project key. But there is several reasons to break this beauty.

  • I need integration with IntelliJ and currently the only option seems to take IntelliJ SonarQube plugin and it could support only different project key per module.
  • I need different quality profiles and quality gates per module as they are too different.
  • Project modules are going larger and I'd like to have separate tracking over them on Sonar side.

Alternative ideas

Other option looks like to get IntelliJ plugin to work on multi-module Maven project but this anyway does not solve separate quality tracking requirement on Sonar side. And I'm in doubt this is currently possible. I've tried even manually setting project keys per module on Idea side and this only results 1 module working.

Just to note, most of code under this engine is Java but there are also some Scala tools.

RESOLUTION

Agreed with @kraal. By this time I am already familiar with SONAR modules and plugins and SONAR 4.4 brings me flexibility I need without such a hacks with minimal plugin coding or additional processing configuration. Considered closed.

Are you sure that using maven multi-modules is the way to go in your case ?

If you always really need to release all modules simultaneously, if all modules have the same lifecycle (ie you're not in a situation where a module A is modified once per year and a module B is modified once per week) and if the size of each module is acceptable : ok.

Otherwise (if you sometimes release them separately or have stable code not modified anymore or which is rarely modified or if your modules start to be too big) I would rather try to create multiple projects in different SCM repositories instead of using multi-modules.

Think about it.

Edit : if you go the multi projects way, you can then aggregate the quality view using the portfolio plugin.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM