Skip to content

Repository files navigation

SonarQubePlugin

Repository for the SecAI project group for the SonarQube plugin development

This is a short guide on how to setup Sonarqube on your system, and install the "SecAI" custom plugin.

  1. SonarQube installation There are two methods to install SonarQube on your system, either from a ZIP file or via Docker. Method 1:

    Method 2:

  2. Creating a project in SonarQube

  • Once the local host is running then go to projects and select create a local project.
  • Select the display name and project key (I put “secai” in both),.
  • Click next and select use global settings.
  • And click create project.
  • Select analysis method as locally for now.
  • In next step select generate project token and expiration as no expiration. Click next
  • Then you will get a command to run for project on which you want to analyse the code. NOTE: Run this command in cmd/terminal of the host machine not from the IDE terminal (It will not work)
    • Here If you get an error when you first run that command run the below command mvn clean install org.sonarsource.scanner.maven:sonar-maven-plugin:3.5.0.1254:sonar
    • then restart the cmd --- again run the provided command from SonarQube.
  • Once the analysis done you will get report on the webpage.
  1. Running the SecAI plugin
  • Clone this github repository
  • Run “mvn clean package"
  • Go to /target/sonar-plugin-example-x.x.x.tar and copy that file into the directory -> sonarqube server file extensions/plugins/
    • If you are using Docker then docker cp /path/to/your/generated/jar/file {docker_containerID}:/opt/sonarqube/extensions/plugins/ {docker_containerID} : run docker ps to get Id of the running container
  • Restart the SonarQube server
  • Your plugin should be working now!

Automated Plugin Deployment

Here provided a script for automating the deployment of the Sonarqube Plugin using Docker.

Usage

Everytime the changes being made, just run following commands to automate the deployment process:

chmod +x deploy-sonarqube-plugin.sh
./deploy-sonarqube-plugin.sh 

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages