Tuesday 14 June 2016

Sonarcube PDF report generation - Code Review

  • Download Sonarcube 4.5.7 version.
  • Download the pdf repport plugin 1.4 version from. 
    • Copy and paste the pdf report plugin to ../extensions/plugins/
    •  Start the server by running ../bin/StartSonar.bat.



    • Once server is up, create a sonar-project.properties file in either root path or sub module of codebase.
      • o   Eg: root path: ../GIT clone/<Parent folder>/
        o   Sub module path: ../GIT clone/<Parent folder>/<module>
      • Sample sonar-project.properties file
        •  # Required metadata
          sonar.projectKey=org.sonarqube:java-simple-sq-scanner
          sonar.projectName= <<Give any name>>
          sonar.projectVersion=1.0
           
          # Comma-separated paths to directories with sources (required)
          sonar.sources=src
           
          # Language
          sonar.language=java
           
          # Encoding of the source files
          sonar.sourceEncoding=UTF-8

  • PDF can be viewed in different ways:
    • Go to codebase path either root or module folder from command prompt and run mvn sonar:sonar
      • PDF will be generated in target/sonar/ folder.
    • o   Goto Sonarcube server http://localhost:9000 and login as admin/admin.
§  In dashboard add a widget called Pdf Report. Rerun mvn sonar:sonar from command prompt
 
§  In PDF report widget, you can see the generated pdf. 


No comments :

Post a Comment