element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Personal Blogs
  • Community Hub
  • More
Personal Blogs
Legacy Personal Blogs SonarCube integration with Docker
  • Blog
  • Documents
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: PEarle
  • Date Created: 9 Apr 2019 1:46 PM Date Created
  • Views 667 views
  • Likes 3 likes
  • Comments 1 comment
Related
Recommended

SonarCube integration with Docker

PEarle
PEarle
9 Apr 2019

SonarQube is a code analysis tool which can be used as an aid to improving code quality. This page details how I have installed and used it for local development.

Installation

SonarQube is available as a docker instance. To pull an image from docker use

docker pull sonarqube

The instance can be run with default settings using the following command. Note that the default port is 9000

docker run -d --name sonarqube -p 9000:9000 -p 9092:9092 sonarqube

Setup

Got to URL http://localhost:9000/ and login with default user/password admin/admin. You will be prompted with a wizard the first time you logong.

 

This wizzard will allows you to

  • Create a token for use with projects the first time you do this. The token is used to identify you when an analysis is performed.
  • Run analysis over a project. You are prompted for the language and project type, and then a command is generated - e.g. (for a maven project)

mvn sonar:sonar -Dsonar.host.url=http://localhost:9000 -Dsonar.login=a4acbabe08ab339f1ee872d9fa250418c44165a0

 

Code Analysis

To run analysis over a code use mvn sonar:sonar -Dsonar.host.url=http://localhost:9000 -Dsonar.login=[token] (i.e. as shown above) in the project root.  You must have a vallid token. Additional tokens can be created from http://localhost:9000/admin/users - see the Tokens column in this view.

The above command will run the analysis, and the log output will contain a url to view the results - e.g.

ANALYSIS SUCCESSFUL, you can browse http://localhost:9000/dashboard/index/uc-transfers:uc-transfers-persistence

 

  • Sign in to reply

Top Comments

  • ralphjy
    ralphjy over 6 years ago +1
    Interesting. I'll have to give this a try. Pretty comprehensive list of languages covered. At least the ones that I use.
  • ralphjy
    ralphjy over 6 years ago

    Interesting.  I'll have to give this a try.  Pretty comprehensive list of languages covered.  At least the ones that I use.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube