I have posted the same in Stackoverflow -
https://stackoverflow.com/questions/54946420/how-to-integrate-an-angular-projects-jenkinsfile-with-sonarqube
I have an angularjs project. the project has a Jenkinsfile(declarative
pipeline) which can build the jenkinsjob when a push is done. I'm trying to
include a sonarqube action here for static scan. Searched a lot for angular
projects with my scenario. but most of the examples i checked have pom.xml
file(cause they were either java related projects).
I have written a *sonar-projects.properties* in root and added all
necessary item:
sonar.projectKey=apols:webproject
sonar.projectName=webproject
sonar.projectVersion=1.0.0
sonar.projectDescription=Static analysis for the AppName
sonar.sources=www
sonar.exclusions=**/node_modules/**,**/*.spec.ts,**/dist/**,**/docs/**,**/*.js,**/coverage/**
sonar.tests=www
sonar.test.inclusions=**/*.spec.ts
sonar.ts.tslint.configPath=tslint.json
sonar.javascript.lcov.reportPaths=coverage/lcov.info
sonar.ts.coverage.lcovReportPath=coverage/lcov.info
My *Jenkinsfile's sonar scan* portion -
stage('Sonarqube') {
steps {
container('maven') {
script {
withSonarQubeEnv('SonarQube') {
sh 'mvn clean package sonar:sonar'
}
timeout(time: 10, unit: 'MINUTES') {
waitForQualityGate abortPipeline: true
}
}
}
}
}
As you can see i'm using the maven container in jenkins.
When the jenkins job runs, when it executes this line in Jenkinsfile - `sh
'mvn clean package sonar:sonar'` , it checks for the *pom.xml* file and
fails. So how can i point this to my *sonar-projects.properties* .
Please help
--
You received this message because you are subscribed to the Google Groups
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/13011d7d-ad45-4bb0-8d1d-f8f0ea1d7c8e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.