Pages

Friday, August 25, 2017

Jenkins - Sonar Qube Integration

Testing is one of the important aspects of code to identify various issues that can occur while running the code. At the same time it is necessary to examine the code quality while moving the code to production.

Static analysis also called as static code analysis is a method of debugging that is done by examining the code without executing that. This allows developers a better understanding of the code structure and can help developers to ensure that the code adheres to industry standards. The main advantage of the static analysis is that it reveals errors that do not occur until months and years of application running. It is said that the static analysis is only a first step in a comprehensive software quality-control regime. Sonar is one such tool which provides us the static code analysis.

Sonar is an open source web-based application to manage code quality which covers seven axes of code quality as: Architecture and design, comments, duplications, unit tests, complexity, potential bugs and coding rules. Developed in Java and can cover projects in Java, FlexPHPPL/SQL,  Visual Basic 6. It's very efficient to navigate; offering visual reporting and you can follow metrics evolution of your project and combine them.

In this article we will see how we can install SONAR tool and use that.

1. Download SonarQube from here

2. Extract the tar file to /op/sonarqube.
Once extracted move to the /opt/sonarqube/bin/linux-x86-64.And run the “sonar.sh  start”.

That’s all you need to do in starting the sonarqube. Access the sonarqube console using the “localhost:9000” and we can see the web console as below,

 The default credentials for login are admin and admin.

2.In the Jenkins server, install the sonar-qube plugin using the Manage plugins. Configure the Sonar-qube in the “Configure System” as
Since this is a community version, we don't need to add any credentials details.

4.Download the sonar-runner on the slave machine and extract
wget http://repo1.maven.org/maven2/org/codehaus/sonar/runner/sonar-runner-dist/2.4/sonar-runner-dist-2.4.zip

A sonar-runner is the tool that actually scans the source code for conventions and pass them to the sonar qube server for displaying them on web page.

5.Now go to the “Configure Global tool” section and configure sonar-runner under the sonarqube scanner

6.Create a Maven Job and in the Add pre build step , choose a “Execute SonarQube Scanner” option
Fill the details as above.In the path to project properties location , pass the location where sonar.properties exists in the project source code. Naturally this will be present on the root level.

We can either add the sonar.properties file in source code or paste them in the analysis properties field.

In the maven Build arguments pas the "mvn clean install" and see the results in the Sonar qube web application as below,
More to come , Happy learning :-)

127 comments :

  1. bookmarked!!, I like your blog!

    ReplyDelete
  2. I have to thank you for the efforts you've put in penning this website.
    I really hope to view the same high-grade blog posts by you in the future as well.
    In fact, your creative writing abilities has motivated me to get my own site
    now ;)

    ReplyDelete
  3. Good post. I learn something new and challenging
    on blogs I stumbleupon on a daily basis. It's always helpful to read through content from other writers and use a
    little something from other web sites.

    ReplyDelete
  4. Good post. I absolutely love this website. Keep it up!

    ReplyDelete
  5. I absolutely love your blog.. Pleasant colors & theme.
    Did you build this website yourself? Please reply back as I’m planning to create
    my own site and want to know where you got this from or what
    the theme is called. Thanks!

    ReplyDelete
  6. Hi there! I just would like to offer you a big thumbs up for your excellent information you've
    got here on this post. I'll be returning to your site for more soon.

    ReplyDelete
  7. Hi, I do think this is an excellent web site.
    I stumbledupon it ;) I am going to return yet again since i have
    book marked it. Money and freedom is the greatest way to
    change, may you be rich and continue to help other people.

    ReplyDelete
  8. Having read this I believed it was really informative.

    I appreciate you taking the time and energy to put this
    article together. I once again find myself personally spending way too much
    time both reading and posting comments. But so what,
    it was still worthwhile!

    ReplyDelete
  9. I’m amazed, I have to admit. Rarely do I encounter a
    blog that’s both educative and engaging,
    and let me tell you, you have hit the nail
    on the head. The problem is something too few men and women are speaking intelligently
    about. I am very happy I came across this during my hunt for something regarding this.

    ReplyDelete
  10. I absolutely love your site.. Great colors & theme. Did you build this amazing site yourself?
    Please reply back as I’m hoping to create my own website and would
    love to know where you got this from or exactly what the
    theme is named. Appreciate it!

    ReplyDelete
  11. Everything is very open with a really clear clarification of the challenges.
    It was truly informative. Your site is very helpful.
    Thanks for sharing!

    ReplyDelete
  12. I could not refrain from commenting. Very well written!

    ReplyDelete
  13. It’s hard to come by experienced people in this particular topic, but you seem like you know what you’re talking about!
    Thanks

    ReplyDelete
  14. Excellent post! We will be linking to this particularly great article on our site.
    Keep up the great writing.

    ReplyDelete
  15. Pretty! This has been a really wonderful post. Many thanks for
    supplying this information.

    ReplyDelete
  16. Spot on with this write-up, I absolutely feel this site needs a lot more attention. I’ll probably be
    returning to read more, thanks for the information!

    ReplyDelete
  17. You need to take part in a contest for one of the most useful blogs on the
    net. I am going to recommend this site!

    ReplyDelete
  18. Hello there! I could have sworn I’ve visited this site before but after going through a few of the posts I
    realized it’s new to me. Regardless, I’m certainly delighted
    I found it and I’ll be book-marking it and checking back frequently!

    ReplyDelete
  19. Spot on with this write-up, I actually believe that this site needs
    much more attention. I’ll probably be returning to see more, thanks for the info!

    ReplyDelete
  20. Good post. I learn something new and challenging on sites I stumbleupon every day.
    It will always be interesting to read articles from other authors and practice
    something from their websites.

    ReplyDelete
  21. This is a topic that is close to my heart... Take
    care! Exactly where are your contact details though?

    ReplyDelete
  22. Hi, I do believe this is a great website. I stumbledupon it ;) I am going to revisit yet again since I bookmarked it.
    Money and freedom is the greatest way to change, may you be rich and continue to guide other people.

    ReplyDelete
  23. This website really has all of the information I needed concerning this subject and didn’t know who to ask.

    ReplyDelete
  24. Good post! We are linking to this particularly great content on our site.

    Keep up the great writing.

    ReplyDelete
  25. Excellent article. I'm dealing with some of these issues as well..

    ReplyDelete
  26. Aw, this was a really nice post. Taking a few minutes and actual effort to create a very
    good article… but what can I say… I put things off a lot and never manage to get anything
    done.

    ReplyDelete
  27. There's certainly a great deal to learn about this subject.
    I love all of the points you have made.

    ReplyDelete
  28. Hi there! This blog post couldn’t be written any better!
    Going through this article reminds me of my previous roommate!
    He always kept preaching about this. I most certainly will send this post to him.
    Fairly certain he will have a great read. I appreciate you for
    sharing!

    ReplyDelete
  29. This is a very good tip particularly to those fresh to the blogosphere.

    Short but very accurate info… Thank you for
    sharing this one. A must read post!

    ReplyDelete
  30. Spot on with this write-up, I honestly feel this website needs much more
    attention. I’ll probably be returning
    to read through more, thanks for the advice!

    ReplyDelete
  31. Pretty! This was an extremely wonderful post. Thank you for supplying
    this information.

    ReplyDelete
  32. Hello! I just want to give you a big thumbs up for your excellent information you
    have right here on this post. I am coming back to your web site for more soon.

    ReplyDelete
  33. Pretty! This was an incredibly wonderful
    article. Many thanks for supplying this info.

    ReplyDelete
  34. Excellent blog you have here.. It’s difficult to find high quality writing like yours nowadays.
    I seriously appreciate people like you! Take care!!

    ReplyDelete
  35. This is the right website for anybody who wishes to understand this topic.
    You know a whole lot its almost hard to argue with you
    (not that I personally would want to…HaHa).
    You certainly put a brand new spin on a topic that has been discussed for decades.

    Wonderful stuff, just excellent!

    ReplyDelete
  36. Great web site you've got here.. It’s hard to find quality writing like
    yours nowadays. I seriously appreciate individuals like you!

    Take care!!

    ReplyDelete
  37. Your style is so unique in comparison to other folks I've read stuff from.
    Thanks for posting when you have the opportunity, Guess I'll just bookmark this web
    site.

    ReplyDelete
  38. You are so interesting! I don't think I have read something like that before.
    So great to discover somebody with a few original thoughts on this subject.
    Really.. many thanks for starting this up. This web site is something that is needed
    on the web, someone with a little originality!

    ReplyDelete
  39. Pretty! This has been an extremely wonderful article.
    Thanks for supplying this information.

    ReplyDelete
  40. Greetings! Very helpful advice in this particular post! It's the little
    changes that will make the greatest changes.
    Many thanks for sharing!

    ReplyDelete
  41. I love it when folks get together and share ideas.
    Great site, keep it up!

    ReplyDelete
  42. Right here is the perfect web site for anybody who would like to find out about this topic.
    You realize a whole lot its almost tough to argue with you (not that I actually would want to…HaHa).
    You certainly put a fresh spin on a topic that's been written about for
    a long time. Great stuff, just excellent!

    ReplyDelete
  43. Hi, There's no doubt that your website might be having internet browser compatibility
    issues. When I take a look at your website in Safari,
    it looks fine however when opening in I.E., it has some overlapping issues.
    I merely wanted to give you a quick heads up!
    Apart from that, great site!

    ReplyDelete
  44. Way cool! Some very valid points! I appreciate you writing this
    write-up and also the rest of the website is also really good.

    ReplyDelete
  45. There is definately a lot to learn about this subject. I like all
    the points you have made.

    ReplyDelete
  46. Way cool! Some extremely valid points! I appreciate you penning this write-up and also
    the rest of the website is extremely good.

    ReplyDelete
  47. After checking out a handful of the articles on your web
    page, I honestly appreciate your way of writing a
    blog. I saved it to my bookmark site list and will be checking back
    in the near future. Take a look at my web site too and tell me your
    opinion.

    ReplyDelete
  48. I'm very happy to uncover this web site. I want to to thank you for your time just for this
    fantastic read!! I definitely savored every little bit of it and i also have you
    bookmarked to look at new information in your blog.

    ReplyDelete
  49. I was able to find good advice from your articles.

    ReplyDelete
  50. Oh my goodness! Awesome article dude! Many thanks, However I am
    going through difficulties with your RSS. I don’t know why I cannot subscribe to
    it. Is there anyone else having identical RSS issues?
    Anybody who knows the answer will you kindly respond? Thanks!!

    ReplyDelete
  51. Very good info. Lucky me I ran across your site by chance
    (stumbleupon). I have book marked it for later!

    ReplyDelete
  52. Greetings! Very helpful advice within this article! It's the little changes that produce the largest
    changes. Thanks a lot for sharing!

    ReplyDelete
  53. I blog quite often and I seriously appreciate your content.
    This great article has truly peaked my interest. I am going to take a note of your site and keep checking for new information about once per week.

    I opted in for your Feed as well.

    ReplyDelete
  54. I used to be able to find good advice from your articles.

    ReplyDelete
  55. Excellent web site you have here.. It’s hard to find high-quality writing like yours these days.
    I truly appreciate people like you! Take care!!

    ReplyDelete
  56. Good post. I certainly appreciate this site. Keep it up!

    ReplyDelete
  57. Your style is unique compared to other folks I've read stuff from.
    Many thanks for posting when you've got the opportunity, Guess I'll just
    bookmark this site.

    ReplyDelete
  58. Great information. Lucky me I found your blog by chance (stumbleupon).
    I have book marked it for later!

    ReplyDelete
  59. A fascinating discussion is definitely worth comment. I think that you should
    publish more on this issue, it might not be a taboo matter but generally people
    don't discuss these issues. To the next! Kind
    regards!!

    ReplyDelete
  60. That is a good tip particularly to those fresh to the blogosphere.
    Brief but very precise info… Thanks for sharing this one.
    A must read article!

    ReplyDelete
  61. This web site truly has all the information I needed concerning this subject and didn’t know who to ask.

    ReplyDelete
  62. Spot on with this write-up, I seriously think this amazing site needs much more attention. I’ll probably be back again to read through more, thanks for the information!

    ReplyDelete
  63. You should be a part of a contest for one of the finest sites
    on the web. I will highly recommend this blog!

    ReplyDelete
  64. There's certainly a lot to learn about this topic.
    I love all the points you've made.

    ReplyDelete
  65. Right here is the perfect webpage for everyone who really
    wants to find out about this topic. You realize a whole lot its almost hard
    to argue with you (not that I personally would want to…HaHa).
    You certainly put a new spin on a subject which has
    been discussed for decades. Wonderful stuff,
    just wonderful!

    ReplyDelete
  66. Oh my goodness! Amazing article dude! Thank you, However
    I am having difficulties with your RSS. I don’t understand the reason why
    I cannot subscribe to it. Is there anybody having the
    same RSS problems? Anybody who knows the solution will you kindly respond?
    Thanx!!

    ReplyDelete
  67. Hi there! I could have sworn I’ve been to this site before but after
    going through a few of the posts I realized it’s new to
    me. Regardless, I’m definitely happy I stumbled upon it and I’ll be bookmarking it and checking back often!

    ReplyDelete
  68. This site was... how do I say it? Relevant!! Finally I have found something that helped me.
    Thank you!

    ReplyDelete
  69. That is a really good tip particularly to those new to
    the blogosphere. Brief but very precise information… Many
    thanks for sharing this one. A must read post!

    ReplyDelete
  70. I used to be able to find good info from your blog articles.

    ReplyDelete
  71. I could not refrain from commenting. Well written!

    ReplyDelete
  72. I was able to find good info from your articles.

    ReplyDelete
  73. You ought to take part in a contest for one of the finest websites on the net.
    I will recommend this site!

    ReplyDelete
  74. Everything is very open with a precise explanation of the challenges.
    It was definitely informative. Your website is useful. Thank you for sharing!

    ReplyDelete
  75. Very good post. I definitely appreciate this website.

    Thanks!

    ReplyDelete
  76. I’m amazed, I have to admit. Rarely do I come across a blog that’s both
    equally educative and entertaining, and let me tell
    you, you've hit the nail on the head. The problem is an issue that not enough
    folks are speaking intelligently about. I am very happy that I found this in my search for something concerning this.

    ReplyDelete
  77. There's certainly a great deal to find out about this issue.

    I like all of the points you've made.

    ReplyDelete
  78. Your style is really unique compared to other folks I have read stuff
    from. Thank you for posting when you've got the opportunity, Guess I
    will just bookmark this blog.

    ReplyDelete
  79. Howdy! I simply want to offer you a huge thumbs up for your excellent info you've
    got right here on this post. I will be returning to your site for more soon.

    ReplyDelete
  80. Very good post. I will be experiencing a few of these issues as well..

    ReplyDelete
  81. I'm pretty pleased to uncover this page. I need to to thank you for ones time for this fantastic
    read!! I definitely enjoyed every bit of it and i also have you book-marked to see new information on your blog.

    ReplyDelete
  82. Aw, this was a very good post. Taking a few minutes and actual effort to create a good article… but what can I say… I
    hesitate a lot and don't seem to get anything done.

    ReplyDelete
  83. There is certainly a lot to find out about this topic. I love all of the points you've made.

    ReplyDelete
  84. This site was... how do I say it? Relevant!! Finally I've
    found something which helped me. Thanks!

    ReplyDelete
  85. An impressive share! I've just forwarded this onto a colleague who was
    conducting a little research on this. And he actually ordered me breakfast simply because I found it
    for him... lol. So allow me to reword this....
    Thank YOU for the meal!! But yeah, thanks for spending time to talk about this topic
    here on your blog.

    ReplyDelete
  86. An impressive share! I have just forwarded this onto a coworker who was doing a little homework on this.

    And he in fact ordered me lunch simply because I discovered
    it for him... lol. So let me reword this.... Thank YOU for
    the meal!! But yeah, thanks for spending time to talk about
    this issue here on your web page.

    ReplyDelete
  87. Having read this I believed it was very enlightening.
    I appreciate you finding the time and energy to put this information together.

    I once again find myself spending a lot of time both reading
    and leaving comments. But so what, it was still worth it!

    ReplyDelete
  88. Good post! We are linking to this great content on our website.
    Keep up the great writing.

    ReplyDelete
  89. You are so awesome! I don't think I've truly read through something like that before.

    So nice to find somebody with some genuine thoughts on this issue.
    Really.. thanks for starting this up. This web site is one thing
    that's needed on the web, someone with a little originality!

    ReplyDelete
  90. Way cool! Some extremely valid points! I appreciate you penning this post and also the rest of the website is really
    good.

    ReplyDelete
  91. Greetings! Very useful advice within this article!
    It is the little changes that produce the largest changes.
    Thanks a lot for sharing!

    ReplyDelete
  92. Hi! I simply want to give you a huge thumbs up for the excellent info you have here on this post.
    I am coming back to your blog for more soon.

    ReplyDelete
  93. bookmarked!!, I like your website!

    ReplyDelete
  94. I could not resist commenting. Very well written!

    ReplyDelete
  95. I was able to find good info from your blog posts.

    ReplyDelete
  96. Way cool! Some very valid points! I appreciate you writing this
    write-up and the rest of the website is also really good.

    ReplyDelete
  97. This is a really good tip particularly to those fresh to the blogosphere.
    Short but very precise information… Appreciate your sharing this one.
    A must read post!

    ReplyDelete
  98. I have to thank you for the efforts you've put in writing this blog.
    I'm hoping to see the same high-grade blog posts from you later on as well.
    In fact, your creative writing abilities has motivated me to get my own, personal website
    now ;)

    ReplyDelete
  99. Oh my goodness! Awesome article dude! Thanks, However I am
    experiencing difficulties with your RSS. I don’t know the reason why I can't join it.
    Is there anybody else having the same RSS problems?
    Anyone that knows the answer can you kindly respond?
    Thanx!!

    ReplyDelete
  100. Aw, this was an exceptionally good post. Finding the time and actual
    effort to create a top notch article… but what can I say… I put things
    off a whole lot and don't manage to get nearly anything done.

    ReplyDelete
  101. There's definately a lot to learn about this issue.
    I really like all of the points you made.

    ReplyDelete
  102. I wanted to thank you for this wonderful read!!
    I definitely loved every bit of it. I have you saved as a favorite to check out new things you post…

    ReplyDelete
  103. bookmarked!!, I love your blog!

    ReplyDelete
  104. Everything is very open with a really clear description of the challenges.
    It was definitely informative. Your website is very useful.
    Thank you for sharing!

    ReplyDelete
  105. There is definately a great deal to know about this topic.
    I love all of the points you have made.

    ReplyDelete
  106. Everything is very open with a very clear description of the challenges.
    It was definitely informative. Your site is very helpful.

    Thanks for sharing!

    ReplyDelete
  107. I'm very happy to discover this website. I want to to thank you
    for ones time just for this wonderful read!!
    I definitely liked every part of it and i also have you saved to fav to
    look at new information in your blog.

    ReplyDelete
  108. Can I just say what a comfort to discover
    someone who really knows what they are discussing on the internet.
    You certainly realize how to bring a problem to light
    and make it important. More people ought to look at this and understand this side of your story.
    I can't believe you aren't more popular since you definitely
    possess the gift.

    ReplyDelete
  109. Great info. Lucky me I ran across your website by chance (stumbleupon).

    I've saved it for later!

    ReplyDelete
  110. Everything is very open with a precise clarification of
    the challenges. It was truly informative. Your
    website is useful. Thanks for sharing!

    ReplyDelete
  111. Good day! I could have sworn I’ve been to this blog before
    but after going through some of the articles I realized it’s new to me.
    Anyways, I’m certainly happy I discovered it and I’ll
    be book-marking it and checking back regularly!

    ReplyDelete
  112. Good post. I learn something new and challenging on blogs I stumbleupon on a daily basis.
    It will always be helpful to read content from
    other authors and practice a little something from their sites.

    ReplyDelete
  113. This blog was... how do you say it? Relevant!! Finally I have found something that helped me.

    Thank you!

    ReplyDelete
  114. This is a topic that's near to my heart... Best wishes!
    Where are your contact details though?

    ReplyDelete
  115. Good post. I learn something new and challenging on sites I stumbleupon on a daily basis.

    It will always be useful to read through articles from other writers and use something from their sites.

    ReplyDelete
  116. You need to take part in a contest for one of the finest websites on the web.
    I'm going to highly recommend this site!

    ReplyDelete
  117. Your style is really unique in comparison to other folks I have read stuff from.
    Thank you for posting when you have the opportunity, Guess I'll just bookmark this
    page.

    ReplyDelete
  118. Spot on with this write-up, I seriously believe that this amazing site
    needs much more attention. I’ll probably be returning to see more, thanks
    for the info!

    ReplyDelete
  119. I would like to thank you for the efforts you have put in writing this site.
    I'm hoping to view the same high-grade content from you later on as well.
    In fact, your creative writing abilities has motivated
    me to get my very own site now ;)

    ReplyDelete
  120. I’m impressed, I have to admit. Rarely do I encounter a blog that’s both equally educative
    and interesting, and without a doubt, you've hit the nail on the head.
    The problem is something that too few folks are
    speaking intelligently about. I'm very happy I came across
    this in my search for something concerning this.

    ReplyDelete
  121. There is definately a lot to find out about this topic.
    I love all of the points you've made.

    ReplyDelete
  122. After exploring a few of the blog posts on your site, I truly like your technique of writing a blog.

    I added it to my bookmark website list and will be
    checking back soon. Take a look at my website too and
    let me know your opinion.

    ReplyDelete
  123. This is a really good tip especially to those fresh to the blogosphere.
    Simple but very precise info… Appreciate your sharing
    this one. A must read article!

    ReplyDelete
  124. I love reading a post that will make people think.
    Also, thank you for allowing for me to comment!

    ReplyDelete
  125. I was able to find good info from your blog articles.

    ReplyDelete
  126. I could not resist commenting. Perfectly written!

    ReplyDelete
  127. You should be a part of a contest for one of the highest quality blogs on the
    net. I'm going to recommend this site!

    ReplyDelete