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

Direct question:

I need a multi-module Maven project to be integrated with Sonar where each module will have a separate sonar project. What's a working example of how to do this? Maven version 3.0.4, if that matters.

A slightly more detailed explanation of why

Yes, I have a 100% working multimodal project that maps to one Sonar project project. But there are several reasons to break this beauty.

  • I need IntelliJ integration and currently the only option is probably using the IntelliJ SonarQube plugin and it can only support a different project key for each module.
  • I need different quality profiles and quality doors for each module as they are too different.
  • The modules of the project will grow and I want to have separate tracking for them on the sonar side.

Alternative ideas

Another option is similar to making the IntelliJ plugin work on a multi-module Maven project, but that doesn't address the separate quality tracking requirements on the Sonar side anyway. And I doubt that this is possible at this time. I've even tried manually setting project keys for each module on the Idea side and this only makes 1 module work.

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

Decision

Agreed with @kraal. By this time I'm already familiar with SONAR modules and plugins, and SONAR 4.4 brings me the flexibility I need without such hacks with minimal plugin coding or additional processing configuration. It is considered closed.

+3


source to share


1 answer


Are you sure using maven multimodules is the way to go in your case?

If you always need to release all modules at the same time, if all modules have the same lifecycle (i.e. you are not in a situation where module A changes once a year and module B changes once a week) and if the size each module is acceptable: ok.

Otherwise (if you occasionally release them separately, or you have stable code that is no longer modified or rarely changes, or if your modules are starting to get too large), I would rather try to create multiple projects in different SCM repositories instead of modules.



Think about it.

Edit: if you are navigating multiple projects, you can then aggregate the quality view using the portfolio plugin.

+1


source







All Articles