Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using sonar on big projects

I'm working on one fairly big project (around maven 550 modules). Now, I was wondering how to run sonar on such a big project at the level of CI (we use Jenkins for this)

If we run mvn sonar:sonar out of parent pom folder, it runs for ~1 hour and then just fails on OutOfMemory even if we increase it significantly (~16GB)

So, we examine other strategies of running sonar. Currently the most appealing ideas are:

  1. Run sonar for each module during the lifecycle.

  2. Maintain the list of (sub)modules for which the sonar should be run in parallel during the post build phase.

So, I would like to ask what is the best way to run sonar for such a big project? Could someone please provide some generic configuration for implementing the first or second idea or describe any other way/best practices?

like image 493
Mark Bramnik Avatar asked Sep 06 '15 11:09

Mark Bramnik


People also ask

What is project sonar and why should I Care?

Ok, but why? Project Sonar, developed by Rapid7, is an internet-wide survey that aims to gather large amounts of information such as port scan data, SSL certificates, and DNS records. Moreover, Rapid7 very generously makes these datasets available to Security Researchers at no additional cost.

How do I create a sonar project?

Create a file named sonar-project.properties insider your project directory with following contents. sonar.projectKey=YourProjectKey sonar.projectName=YourProjectName sonar.projectVersion=1.0 sonar.sources=. open http://localhost:9000 in browser. login with default username & password ( admin, admin ).

Do I need a build server for sonar?

It's not necessary to install a build server, so long as your projects are maven-enabled you should be able to just do mvn sonar:sonar whilst a local sonar server is running. You can also install the eclipse plugin (if you use eclipse) which will allow you to do realtime code analysis - so you can see when you've managed to solve a violation.

What is Rapid7’s project sonar?

Project Sonar, developed by Rapid7, is an internet-wide survey that aims to gather large amounts of information such as port scan data, SSL certificates, and DNS records. Moreover, Rapid7 very generously makes these datasets available to Security Researchers at no additional cost.


1 Answers

that sure are lot of modules. not sure if it is best practice or if you have already tried this but,

  1. u can configure plugin execution using profiles.
  2. also each profile will include very related set of modules for such build

now select profile one after another in required order to build.

Ref - http://maven.apache.org/guides/introduction/introduction-to-profiles.html taken from below stackoverflow post In Maven, how to run a plugin based on a specific profile

like image 82
Saurabh Avatar answered Nov 14 '22 23:11

Saurabh