Automate Static Code Quality Analysis with SonarCloud from Jenkins
- Login to https://sonarcloud.io/
- Click on SCM tool
Depending on your SCM tool, We will use GitHub. So please click on it.
Enter GitHub credentials to setup your account in SonarCloud. Click Authorize SonarQube Cloud.
Choose “Import from GitHub” (or connect GitHub) and Install the SonarCloud GitHub App
Start analyzing a project:
Select Maven, note organization key, project key and token.
Pre-requisites in Jenkins:
- SonarQube plug-in - Make sure this plug-in is installed.
- pipeline stage view plug-in
Jenkins Pipeline code for running scan in SonarCloud
node {
def mvnHome = tool 'Maven3'
stage ("checkout") {
stage ('build') {
sh "${mvnHome}/bin/mvn clean install -f MyWebApp/pom.xml"
}
stage ('Code Quality scan') {
withSonarQubeEnv('SonarCloud') {
}
def mvnHome = tool 'Maven3'
stage ("checkout") {
git branch: 'main', credentialsId: '', url: 'https://github.com/akannan1087/my-javawebapp-repo'
}stage ('build') {
sh "${mvnHome}/bin/mvn clean install -f MyWebApp/pom.xml"
}
stage ('Code Quality scan') {
withSonarQubeEnv('SonarCloud') {
sh """
${mvnHome}/bin/mvn -f MyWebApp/pom.xml \
org.sonarsource.scanner.maven:sonar-maven-plugin:4.0.0.4121:sonar \
-Dsonar.organization=org_key \
-Dsonar.projectKey=com.dept.app:MyWebApp \
-Dsonar.projectName=MyWebApp
"""
}}
}
Now login to SonarCloud under --> https://sonarcloud.io/projects
Here is the pipeline view:
Watch steps in YouTube Video:












Starting a business requires proper legal recognition and structured compliance. When you plan to Register A Company In India, it is important to choose the right business structure, secure name approval, and complete all required government filings. Accurate documentation ensures smooth incorporation and long-term credibility. With professional assistance from Taxlegit, entrepreneurs can complete the registration process efficiently and focus on building and managing their business operations confidently.
ReplyDelete
ReplyDeleteDarpan registration is mandatory for NGOs seeking government grants and recognition. NGOExperts assists with complete documentation, online application filing, and follow-ups on the NGO Darpan portal. Our experts ensure error-free submission so your organization receives its unique ID smoothly and becomes eligible for government schemes.