Sonarqube

来自linux中国网wiki
Evan讨论 | 贡献2024年9月3日 (二) 13:00的版本 →‎安装Sonar-Scanne
跳到导航 跳到搜索

安装Sonar-Scanne

zip https://docs.sonarsource.com/sonarqube/latest/analyzing-source-code/scanners/sonarscanner/


 cd data/apps
10006  ls
10007  unzip sonar-scanner-cli-6.1.0.4477-linux-x64.zip

vim /etc/profile

#配置sonar-scanner

export SONARRUNNER_HOME=/home/evan/data/apps/sonar-scanner-6.1.0.4477-linux-x64
export PATH=$SONARRUNNER_HOME/bin:$PATH


vi sonar-project.properties
# must be unique in a given SonarQube instance
sonar.projectKey=mytest
# this is the name displayed in the SonarQube UI
sonar.projectName=mytest
sonar.projectVersion=1.0
sonar.java.binaries=target/classes
sonar.sources=src
sonar.host.url=http://192.168.10.105:30004
sonar.login=admin
sonar.password=12345
sonar.java.binaries=target/classes
sonar.java.test.binaries=target/classes
sonar.java.surefire.report=target/surefire-reports

  509  sonar-scanner

00:31:42.783 INFO  Analysis total time: 6.861 s
00:31:42.784 INFO  EXECUTION SUCCESS
00:31:42.784 INFO  Total time: 8.380s


 Maven Fatal error compiling: 错误: 无效的目标发行版:17

升级jdk 
jave home 改为 21的 或者大于17的


references

devops [持续交付实践] 基于 sonarqube 的代码检查平台实现