You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Sonar Scanner无法识别Xcode项目目录,仅扫描ApolloCodegen文件夹

SonarQube扫描iOS项目异常:仅检测ApolloCodegen文件夹,未扫描MARi主项目

我集成SonarQube扫描Xcode项目后,执行扫描时仅检测到项目中的ApolloCodegen文件夹,完全没有扫描MARi主项目。扫描能正常完成,但所有检测出的错误都来自我本想排除的ApolloCodegen和Pods文件夹。

以下是我的sonar-project.properties配置:

# Sonar Server details
sonar.host.url=http://localhost:9000
sonar.login=admin
sonar.password=Test123.
sonar.token=******TOKEN******
sonar.projectKey=MARi
#sonar.projectName=MARi
# defaults to ‘not provided’
#sonar.projectVersion=1.0
# Path is relative to the sonar-project.properties file. Defaults to .
sonar.sources=.
sonar.sourceEncoding=UTF-8
# Xcode project configuration (.xcodeproj)
# and use the later to specify which project(s) to include in the analysis (comma separated list)
# Specify either xcodeproj or xcodeproj + xcworkspace
sonar.swift.project=MARi.xcodeproj
sonar.swift.workspace=MARi.xcworkspace
# Scheme to build your application
sonar.swift.appScheme=MARi Zeta
sonar.swift.appConfiguration=Debug
# Destination Simulator to run surefire
# As string expected in destination argument of xcodebuild command
# Example = sonar.swift.simulator=platform=iOS Simulator,name=iPhone 7,OS=12.0
sonar.swift.simulator=platform=iOS Simulator,name=iPhone 14 Pro Max,OS=16.2

sonar.language=swift
#sonar.inclusions=**/*Test*/**
#sonar.inclusions=**/.swift/**/*
sonar.coverage.inclusions=**/*.swift, **/*.swiftmodule
sonar.projectBaseDir=../
#sonar.exclusions=**/*.xml,Pods/**/*,Reports/**/*,ApolloCodegen/**
sonar.coverage.exclusions=**/Pods/**/*,**/ApolloCodegen/**/*
# Path to test directories (comment if no test)
# sonar.tests=testTests,testUITests

我已经尝试了多种包含与排除规则的组合,但结果始终一致:仅ApolloCodegen文件夹被扫描,从未扫描MARi主项目。项目层级结构和扫描响应结果如图所示(注:图片未提供)。我试过能找到的所有包含/排除规则变体,均无法解决问题,若需要更多信息可告知。

内容的提问来源于stack exchange,提问作者Sarmad Zaheer

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.23 15:31:29