sonarqube-scan

SonarQube MSBuild Scanner doesn't exclude files from analysis

两盒软妹~` 提交于 2020-01-21 01:42:06
问题 We are currently using SonarQube Scanner for VSTS/TFS 4.1.1 (which is using SonarQube Scanner 4.1.1). What we want to do: For some projects (modules) in our solution we want to exclude files from the analysis and from the code coverage statistics. This should be done in a maintainable way by using file patterns and not modifying the TFS Build task. Project structure: |- Source |- ProjectA |- Scripts (should be excluded) |- OwnCode |- ProjectB |- Views (only code coverage should be excluded) |

Sonar scanner with Maven and JDK 11

依然范特西╮ 提交于 2020-01-13 10:56:30
问题 I can make Sonar scanner work with OpenJDK 8 but not with OpenJDK 11. The Maven command used is: mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent verify sonar:sonar -Dsonar.analysis.mode=preview -Dsonar.report.export.path=sonar-report.json -P ci The build fails with: [ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.4.0.905:sonar (default-cli) on project framework-bio: Execution default-cli of goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.4.0

SonarQube for MSBuild - End Analysis: Error during SonarQube Scanner execution Line out of range in the file

☆樱花仙子☆ 提交于 2020-01-06 15:17:23
问题 ##[error]15:41:48.530 ERROR: Error during SonarQube Scanner execution ##[error]java.lang.IllegalStateException: Line 33 is out of range in the file Controllers/BaseAccessRequestController.cs (lines: 30) I am using Sonar 5.6.5 version and MSBuild 14. Sonar is running as Windows Service. If I exclude this controller then same error comes for other random controller. If I exclude all controllers but keep one or two for which unit tests are written then error goes away but the coverage is shown

Configure SonarQube on Jenkins

眉间皱痕 提交于 2020-01-06 06:42:14
问题 I have SonarQube and Jenkins dockerized(They're running on different containers); sonar is running on localhost:9000 and Jenkins is running on localhost:8080. I configured the Sonar credentials(with acces Token) on Jenkins, but i when run SonarScanner I'm getting the following error by SonarScaner on Jenkins: ERROR: SonarQube server [http://localhost:9000] can not be reached INFO: ---------------------------------------------------------------- INFO: EXECUTION FAILURE INFO: ------------------

Access SonarQube API with FetchAPI doesn't return any result

烂漫一生 提交于 2020-01-06 05:03:45
问题 I am trying to access SonarQube API through Fetch but it doesn't seem to be responding with any results. It just resolves with an opaque token. Let me share what I have done so far: fetch("http://localhost:9000/api/issues/search?pageSize=500&componentKeys=bactch_analysis_key",{ mode:'no-cors' }) // Call the fetch function passing the url of the API as a parameter .then( res => res.json() ) .then(data => { console.log(data); }) .catch(err => { console.log(err); }); I am setting the mode as no

MS build and SonarQube analysis from jenkins, unable to execute Sonar, E170001

喜夏-厌秋 提交于 2020-01-05 04:09:07
问题 I'm trying to build a .Net project and start the sonarqube code analysis with jenkins. I did the following steps: Download SonarQube Start the SonarQube server: C:...\sonarqube\bin\windows-x86-64\StartSonar.bat Install SonarQube 2.4.4 Plugin on Jenkins Go to http://localhost:8080/configure and configure the SonarQube server as shown here: Go to http://localhost:8080/configureTools/ and configure SonarQube Scanner for MSBuild like this: Added a job in jenkins, configured the project to be

Importing python test run information into sonarqube

≯℡__Kan透↙ 提交于 2020-01-04 06:33:19
问题 I have a python project with structure like this and I'm trying to import it into SonarQube: root sonar-project.properties src test nosetests.xml All test files are in test folder. nosetests.xml is xml report generated with nose(tests) (1.3.7). My sonar-scanner.properties file looks like this sonar.projectKey=python-sonar sonar.projectName=python-sonar sonar.projectVersion=1.0 sonar.sources=src sonar.tests=test sonar.language=py sonar.sourceEncoding=UTF-8 #I want the details so this is false.

Quality Gate Failure in SonarQube does not fail the build in Teamcity

时光毁灭记忆、已成空白 提交于 2020-01-01 11:58:10
问题 I set up a Build project in TeamCity and integrated Sonarqube with it. The project is getting build and even publish the report successfully in SonarQube console. But when the quality gate fails, it's not breaking the build. I searched and read about the build breaker, but its already supported with Sonarqube plugin of TeamCity as this document https://confluence.jetbrains.com/display/TW/SonarQube+Integration Am I missing something to configure/or any gotcha? I tried to search a lot but didn

SonarQube upgrade from 6.4 to 6.5 breaks the scanner

不打扰是莪最后的温柔 提交于 2020-01-01 04:50:22
问题 I am on sonarQube6.4 and have upgraded to 6.5 Sonar-scanner is 3.0.3 Now after the upgrade the scanner fails anytime there is a java file in the source path. If I don't scan java files everything works just fine. However If I rollback an use 6.4 version, everything works fine, so is there any regression? This is the stack trace, when I run the scanner command with -X command. So is it a mandate in 6.5 to provided the location of all compiled classed, is there a way to ignore it. 04:56:21.218

How to react on SonarQube Quality Gate within Jenkins Pipeline

一世执手 提交于 2019-12-31 22:39:08
问题 Within my Jenkins Pipeline I need to react on the SonarQube Quality Gate. Is there an easier way to achieve this but looking in the Sonar-Scanner log for the result page (e.g. https://mysonarserver/sonar/api/ce/task?id=xxxx) and parse the JSON Result from there? I use Jenkins 2.30 and SonarQube 5.3 Thanks in advance 回答1: Based on Vincent's answer, and using Pipeline utility steps, here's my updated version that worked for me (using sonarscanner report file) : withSonarQubeEnv('SONAR 6.4') {