To install this plugin in your IntelliJ IDE:
Go to File > Settings > Plugins.
Search for SonarLint
Launch the installation
1. Download and install SonarQube-8.5 Community edition or higher version.
e.g., install under C:\sonarQube\sonarqube-<version>
2. Modify wrapper.conf (located under C:\sonarQube\sonarqube-\
wrapper.java.command=C:/Program Files/ojdkbuild/jdk-11.0.8/bin/java
Java path might be installed in different location, make sure to use the right path.
Note: You must download and config java 11 to execute SonarQube.
3. Delete all plugins (jars) under C:\sonarQube\sonarqube-\
except of sonar-java-plugin-\
4. Download and copy the plugin Snapshots
java-custom-rules-\
to
C:\sonarQube\sonarqube-\
5. Start SonarQube server:
- open C:\sonarQube\sonarqube-<version>\bin\windows-x86-64\ in File Explorer
- open cmd (windows) pointing to that path by typing cmd in the Address Bar in File explorer
- execute StartSonar.bat in cmd
- wait for server to be up and running, you supposed to see below message:
jvm 1 | 2020.12.28 12:41:35 INFO app[][o.s.a.SchedulerImpl] SonarQube is up
6. Open your browser and type http://localhost:9000/ (9000 is default)
log-in using default System Administrator credentials (login=admin, password=admin).
7. Create Quality Profiles.
Quality Profiles are sets of rules to be applied on project when scanned.
Follow below steps in order to import k2view customized QPs.
- [Download](/articles/COE/SonarQube/02_Installation) k2view_profiles.zip
and extract XML and Java profiles and save the in temporary place.
- Open SonarQube UI, Go to Home Page --> Quality Profiles --> Restore
- You will be asked to choose a back up file, choose the files you extracted for XML and Java.
- After restoring set each profile as Default.
Note: For any configuration changes go to conf folder and sonar.properties file. Here you can configure database, LDAP, webserver, SSO authentication, logging, etc.
For port changes, under web-server section, you can add sonar.web.port=9001.
1. Download and Install sonarScanner
e.g., install under c:\sonarQube\sonar-scanner-<version>-windows
2. In the window, register sonar scanner executable under the "Path" environment variable.
- Type env in Windows Start Search and hit enter
- Click on Environment Variables button
- Look for "Path" environment variable and double click on it
- Click New and set the path of the bin folder of downloaded scanner
e.g. C:\SonarQube\sonar-scanner-4.5.0.2216-windows\bin
3. Set SonarQube user/password
Set the user/password you use to login SonarQube UI in sonar scanner properties file.
look for sonar-scanner.properties under conf folder e.g. C:\SonarQube\sonar-scanner-4.5.0.2216-windows\conf\sonar-scanner.properties
open this file with any text editor and add the below properties:
sonar.login=
e.g.
sonar.login=admin
sonar.password=admin
Note: If while installing SonarQube server you decided to use different port than the default, you will need to set the port in scanner properties file.
Modify prop sonar.host.url within sonar-scanner.properties to point to your sonarQube server:
• Local sonarQube server: -
sonar.host.url= http://localhost:9000 (default)
• Remote sonarQube server: -
sonar.host.url= http(s)://IP:Port
To install this plugin in your IntelliJ IDE:
Go to File > Settings > Plugins.
Search for SonarLint
Launch the installation
1. Download and install SonarQube-8.5 Community edition or higher version.
e.g., install under C:\sonarQube\sonarqube-<version>
2. Modify wrapper.conf (located under C:\sonarQube\sonarqube-\
wrapper.java.command=C:/Program Files/ojdkbuild/jdk-11.0.8/bin/java
Java path might be installed in different location, make sure to use the right path.
Note: You must download and config java 11 to execute SonarQube.
3. Delete all plugins (jars) under C:\sonarQube\sonarqube-\
except of sonar-java-plugin-\
4. Download and copy the plugin Snapshots
java-custom-rules-\
to
C:\sonarQube\sonarqube-\
5. Start SonarQube server:
- open C:\sonarQube\sonarqube-<version>\bin\windows-x86-64\ in File Explorer
- open cmd (windows) pointing to that path by typing cmd in the Address Bar in File explorer
- execute StartSonar.bat in cmd
- wait for server to be up and running, you supposed to see below message:
jvm 1 | 2020.12.28 12:41:35 INFO app[][o.s.a.SchedulerImpl] SonarQube is up
6. Open your browser and type http://localhost:9000/ (9000 is default)
log-in using default System Administrator credentials (login=admin, password=admin).
7. Create Quality Profiles.
Quality Profiles are sets of rules to be applied on project when scanned.
Follow below steps in order to import k2view customized QPs.
- [Download](/articles/COE/SonarQube/02_Installation) k2view_profiles.zip
and extract XML and Java profiles and save the in temporary place.
- Open SonarQube UI, Go to Home Page --> Quality Profiles --> Restore
- You will be asked to choose a back up file, choose the files you extracted for XML and Java.
- After restoring set each profile as Default.
Note: For any configuration changes go to conf folder and sonar.properties file. Here you can configure database, LDAP, webserver, SSO authentication, logging, etc.
For port changes, under web-server section, you can add sonar.web.port=9001.
1. Download and Install sonarScanner
e.g., install under c:\sonarQube\sonar-scanner-<version>-windows
2. In the window, register sonar scanner executable under the "Path" environment variable.
- Type env in Windows Start Search and hit enter
- Click on Environment Variables button
- Look for "Path" environment variable and double click on it
- Click New and set the path of the bin folder of downloaded scanner
e.g. C:\SonarQube\sonar-scanner-4.5.0.2216-windows\bin
3. Set SonarQube user/password
Set the user/password you use to login SonarQube UI in sonar scanner properties file.
look for sonar-scanner.properties under conf folder e.g. C:\SonarQube\sonar-scanner-4.5.0.2216-windows\conf\sonar-scanner.properties
open this file with any text editor and add the below properties:
sonar.login=
e.g.
sonar.login=admin
sonar.password=admin
Note: If while installing SonarQube server you decided to use different port than the default, you will need to set the port in scanner properties file.
Modify prop sonar.host.url within sonar-scanner.properties to point to your sonarQube server:
• Local sonarQube server: -
sonar.host.url= http://localhost:9000 (default)
• Remote sonarQube server: -
sonar.host.url= http(s)://IP:Port