Installing CodeScan Self-Hosted
As part of our commitment to providing the best possible products and services, we periodically discontinue support for older software versions. All CodeScan self-hosted versions below 23.1.1 will reached their End of Life (EOL) on December 31, 2024.
CodeScan Self-Hosted Installation
What's New:
CodeScan Self-Hosted now has two versions available to meet your operating system needs:
CodeScan version 25.1.0 Eagle Edition v3.0 (now compatible with SonarQubeâĸ versions 10.1 to 2025.1 LTA) is the latest CodeScan release. We strongly recommend all CodeScan users upgrade to this iteration.
CodeScan version 25.0.1 Tiger Edition v3.0 (now compatible with SonarQubeâĸ version 10.3 or earlier) is a newer version of the CodeScan release for users running older versions of SonarQubeâĸ.
SonarQube Compatibility Matrix
CodeScan Downloads & Compatibility Chart
Overview
This section describes installing the CodeScan self-hosted server, allowing you to experience a fully functional evaluation version of enterprise CodeScan on your server.
Prerequisites
Step 1: Request a CodeScan License Key
Note: If you already have a License Key or Subscription Code, proceed to step 2.
AutoRABIT Access/License Key: Before downloading the necessary files, email AutoRABITâs support team at support@autorabit.com to request a CodeScan License Key.
Provide the following information in the email: âĸ Client Name (first and last â typically the admin) âĸ Client Company âĸ Email âĸ Duration of License (e.g., varies, 30 days)
Step 2: Download and Install SonarQubeâĸ & CodeScan Zip Files
SonarQubeâĸ Download
You must have a SonarQubeâĸ server currently running in your environment. If not, please visit SonarQube.org to download the latest Community version.
The following matrix identifies the current versions of SonarQubeâĸ supported for CodeScan Self-Hosted clients:
SonarQubeâĸ Compatibility Matrix
Check your SonarQube compatibility in the matrices below based on your CodeScan version.
At SonarSource.com, find the latest compatible version with the CodeScan version you are using.
Note: This link will take you to the SonarQubeâĸ 9.9 LTA download.
CodeScan Downloads & Compatibility Chart
CodeScan Zip File Download
Find the latest compatible CodeScan version and download it from the chart below. Release notes are also provided for your convenience.
Note: Keep in mind you need to download a version compatible with your SonarJS plugin version. Refer to the requirement section for more information.
Accept our Terms of Service and click on the
Request Download
button.Extract the ZIP file. It contains the SonarQubeâĸ plugin and an ant-based tool enabling you to run an analysis.
Plugin Installation
Step 1: Download CodeScan file
Delete any existing Salesforce plugins from your installation.
Ensure your SonarJS plugin is compatible with the current CodeScan for Lightning version. Currently the supported release requires version 6.2+ of the SonarJS plugin. Click here to see alternatives.
Step 2: CodeScan JAR file
Copy CodeScan downloads JAR files,
sonar-salesforce-plugin-XXX.jar
andsonar-codescanlang-plugin-XXX.jar
into your SonarQubeâĸ installation at /extensions/plugins/.Place JAR files into your SonarQubeâĸ file installation at /extensions/plugins/.
Keep the SonarQubeâĸ file open for the next steps.
Step 3: Start Web Server
Lastly, you need to RUNsonar to execute the script to start the server. In your SonarQubeâĸ installation file, open, '/bin' folder, choose server type, and select âStartSonarâ. Once rendering is finished, the plugin installation is complete.
Standard SonarQubeâĸ Setup
Step 1: Log in to the SonarQubeâĸ self-hosted instance at http://localhost:9000/. The default System Admin credentials are admin/admin:
Step 2. Once you've gained access, go to Administrator > Configuration > General Settings
.
Select the CodeScan tab.
Enter your CodeScan License Key in the designated field.
Click Save.
You have successfully completed the CodeScan self-hosted integration. See the instructions below on how to integrate this to ARM.
CodeScan Self-Hosted + ARM Integration
Overview
This guide will show you how to integrate the CodeScan self-hosted instance with ARM.
CodeScan Self-Hosted ARM Integration
Step 1: Generate a SonarQubeâĸ Token
Log in to your SonarQubeâĸ instance.
Go to User > My Account > Security. Your existing tokens are listed here, each with a Revoke button.
The form at the bottom of the page allows you to generate new tokens. Once you click the Generate button, you will see the token value. Be sure to copy it immediately; once you dismiss the notification, you will not be able to retrieve it.
This token is used when storing your credentials, such as your username and password, with AutoRABIT.
Step 2: Store Your SonarQubeâĸ Credentials in ARM
This initial step is when your SonarQubeâĸ credentials, such as your username and password, are stored in AutoRABIT.
Log in to your AutoRABIT account.
Hover your mouse over the Admin module and click on the Credentials tab.
Next, click on Create Credential from the right navigation bar.
On the next pop-up screen, enter the Credential Name.
Choose the Credential Type as Username with Password.
Choose your Credential Scope: Global: Credentials accessible within the team. Private: Credentials for private use.
Enter your SonarQubeâĸ account username. For password, use the copied token mentioned in Step 1.
Verify you are using your SonarQubeâĸ username instead of the email address you use to log in to SonarQubeâĸ.
Click Save.
Setting up Your Quality Profiles
In the SonarQubeâĸ self-hosted instance, click on the
Quality Profiles
menu.Make sure you have selected the
Salesforce Lightning profile
as the default for both the JavaScript and Visualforce and Lightning languages. This can be done with the settings cog to the right of the profile name.
Running a Scan
There are a few ways to run your scan. The first is using our SFDX plugin (this requires that the Salesforce CLI and the SFDX CodeScan Plugin be installed).
Generate a token from the
My Account > Security
menu in SonarQubeâĸ.Open the command prompt and navigate to:
Run the following command:
The Organization Key above will work for the Community edition of SonarQubeâĸ but may need to be edited depending on your setup using a paid edition.
You can also use Ant (this requires Ant version 1.9+).
Note: You will need to edit antbuild.properties
if your SonarQubeâĸ installation is different than usual, or if you have a proxy. You can also edit /runner/antbuild.xml
to customize your workflows.
Running SFDX plugin behind a proxy
To run the SFDX plugin behind a proxy, you will need to pass all the related information in the parameters of the analysis command.
Example:
where,
instanceurl
Enter your CodeScan instance url example- https://app.codescan.io for US region https://app-eu.codescan.io for EU region https://app-aus.codescan.io for AUS region.
TKN
Enter your CodeScan security token (For more information on how to generate a security token, see Security Token)
PRJ
Enter your CodeScan project key (to find your project key, refer to this article: Project Key)
ORG
Enter your CodeScan organization (for more information, see Create a new CodeScan Organization)
SonarQubeâĸ ant plugin
For more instructions on setting up the SonarQubeâĸ ant plugin, see https://docs.sonarqube.org/latest/analysis/scan/sonarscanner-for-ant/. You should verify that the ant script's steps are appropriate for your requirements.
Create a copy of the
sonar-project-template
folder in the runner directory of this folder and put it in the same project. Callit /runner/my-project
. Add the following to thesonar-project.properties
file in themy-project
folder.Set sonar.login= to a token available from the
My Account > Security menu
in SonarQubeâĸ.Set sonar.projectKey=myproject
Set sonar.projectName=My Project
Set salesforce.username, salesforce.password and salesforce.url to your Salesforce username/password. Your Salesforce token must also be appended to the end of your salesforce.password parameter. For example:
salesforce.password=passwordtoken
.Setting your Salesforce username, password, and URL is unnecessary if you want to analyze static content. Please use a system administrator user profile for this otherwise you may experience strange errors when downloading the code or executing tests.
Open a command prompt and navigate into
/runner/my-project
Run the following command:
Note: If the Anyone group is not granted Execute Analysis permission, or if the SonarQubeâĸ instance is secured (sonar.forceAuthentication property
is set to true
), a user whose credentials have Execute Analysis
permission has to be provided through the sonar.login
and sonar.password properties
.
Proxies
If your network has a proxy, you must pass some more parameters to avoid license errors.
A guide for this is available HERE.
Having trouble?
Read the tutorials
Check the troubleshooting section
Contact Support@autorabit.com.
Last updated
Was this helpful?