Sunday, 16 February 2020

Sonar Qube

1. Using CommandLine:

Sonar Qube Installation on Mac using Homebrew

Prerequisites: Installation of Homebrew would be ready
http://brew.sh/

For installation of SonarQube
  1. Java would be installed on your machine. Installation link: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
  2. On terminal window type "brew install sonar". After completion.
  3. On terminal window type "brew install sonar-runner". After completion
  4. On terminal window type "sonar console". This would start sonar server. For checking type http://localhost:9000/ .  or command →  run:sonar console
  5. Once done for your  Projects create the sonar-project.properties file. A dummy sonar-project.properties file is created here:
    # Required metadatasonar.projectKey=spring_boot_s3bucketsonar.projectName=My first Project to be analyzedsonar.projectVersion=1.0
    # Comma-separated paths to directories with sources (required)sonar.sources=src
    # Languagesonar.language=java
    # Encoding of the source filessonar.sourceEncoding=UTF-8
  6. Now go to the project directory in terminal type the command "sonar-runner" to execute SonarQube for your project
  7. The output would be shown as below:

2. In IntelliJ Idea IDE :

Add a plugin of sonar in pom.xml 

 org.sonarsource.scanner.maven

sonar-maven-plugin
3.3.0.603
After adding plugin do clean and install before running sonar:sonar

after ANALYSIS SUCCESSFUL, you can browse http://localhost:9000/dashboard/index/


3: SonarLint

Step 1: Install SonarLint plugin in intelli

After restart you can see SonarLint near to status bar cliack on that and run . It will show the results like beloew.

For SVN scan we need permission which is not there so getting below error:
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.3.0.603:sonar (default-cli) on project pcressentials-id-web: Error when executing blame for file src/main/java/com/thermofisher/pcressentials/id/api/impl/HeaderLoggerFilter.java: svn: E170001: Authentication required for '<https://svn.amer.thermo.com:443> SONIA :: SCM Manager' -> [Help 1]


Related Posts:

  • Sonar Qube 1. Using CommandLine: Sonar Qube Installation on Mac using Homebrew Prerequisites: Installation of Homebrew would be ready http://brew.sh/For i… Read More
  • Jenkins step by step Download Jenkins : https://jenkins.io/download/ How to change default port of jenkins cd /Applications/Jenkins  sudo vi winstone.prop… Read More
  • Testing Framework If you don't want to ignore the test use @ignore *Exceptional Case*   … Read More
  • Linux/Mac Tech Tips Q. How do you list the files in current directory sorted by size in a UNIX machine?  ls -l | grep ^- | sort -nr Q. How do you delete blank… Read More
  • Restful WebService deep dive POX  Plain old XML Resource:  vacation packages, reviews, Deals HTTP Verbs: CRUD Methods, GET PUT DELETE POST HATEOAS. Hypermedia A… Read More