查看“Sonarqube”的源代码
←
Sonarqube
跳到导航
跳到搜索
因为以下原因,您没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看与复制此页面的源代码。
=server= Installing SonarQube from the Docker image 参考 https://docs.sonarsource.com/sonarqube/10.5/setup-and-upgrade/install-the-server/installing-sonarqube-from-docker/ <pre> login: admin password: admin cat docker-compose.yml version: "3" services: sonarqube: image: sonarqube:community depends_on: - db environment: SONAR_JDBC_URL: jdbc:postgresql://db:5432/sonar SONAR_JDBC_USERNAME: sonar SONAR_JDBC_PASSWORD: sonar volumes: - sonarqube_data:/opt/sonarqube/data - sonarqube_extensions:/opt/sonarqube/extensions - sonarqube_logs:/opt/sonarqube/logs ports: - "9000:9000" db: image: postgres:12 environment: POSTGRES_USER: sonar POSTGRES_PASSWORD: sonar volumes: - postgresql:/var/lib/postgresql - postgresql_data:/var/lib/postgresql/data volumes: sonarqube_data: sonarqube_extensions: sonarqube_logs: postgresql: postgresql_data: </pre> =安装Sonar-Scanne= zip https://docs.sonarsource.com/sonarqube/latest/analyzing-source-code/scanners/sonarscanner/ <pre> 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 # 有些信息可能要改 eg port 9000 ,password # 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 </pre> = pipeline = <pre> stage('CodeScan'){ steps{ script{ println "CodeScan" //env.projectName = "${JOB_NAME}".split('/')[-1].split('_')[0] // demo3/demo3-maven-service_CI withCredentials([usernamePassword(credentialsId: '2523cbac-a621-4815-b7f8-e68e03e14cba', passwordVariable: 'PASSWORD', usernameVariable: 'USERNAME' )]) { //withSonarQubeEnv{"SonarQube"} sh "/home/evan/data/apps/sonar-scanner/bin/sonar-scanner \ -Dsonar.login=admin \ -Dsonar.password=evan1234 " } } } } } } 换个新的版本 sonarscanner 好了 没好 有可能我写错密码了 直接在pipeline 写了用户密码就好了 03:40:59.391 ERROR Error during SonarScanner CLI execution java.lang.IllegalStateException: Error status returned by url [http://192.168.10.105:9000/api/v2/analysis/jres?os=linux&arch=x86_64]: 401 at org.sonarsource.scanner.lib.internal.http.ServerConnection.callUrl(ServerConnection.java:182) 04:11:01.064 ERROR 04:11:01.064 ERROR Re-run SonarScanner CLI using the -X switch to enable full debug logging. </pre> =trouble= <pre> Maven Fatal error compiling: 错误: 无效的目标发行版:17 升级jdk jave home 改为 21的 或者大于17的 </pre> =references= https://docs.sonarsource.com/sonarqube/10.5/try-out-sonarqube/ [https://testerhome.com/topics/10064 devops [持续交付实践<nowiki>]</nowiki> 基于 sonarqube 的代码检查平台实现] [https://medium.com/@denis.verkhovsky/sonarqube-with-docker-compose-complete-tutorial-2aaa8d0771d4 SonarQube with Docker compose: complete tutorial] [[category:devops]]
返回至
Sonarqube
。
导航菜单
个人工具
登录
名字空间
页面
讨论
变种
视图
阅读
查看源代码
查看历史
更多
搜索
导航
首页
我的导航
关于我
shell
python
ops
linuxchina.net
blog.linuxchina
最近更改
随机页面
帮助
工具
链入页面
相关更改
特殊页面
页面信息