Jenkins拉取BitBucket子模块时出现路径不存在警告的原因
Jenkins中Git子模块出现“Reference path does not exist: Bitbucket Url”警告的原因
先看你提供的Jenkins构建日志:
git submodule init # timeout=10 [WARNING] Reference path does not exist: Bitbucket Url git config -f .gitmodules --get-regexp ^submodule\.(.+)\.url # timeout=10 git config --get submodule.platforms/android/FolderName.url # timeout=10 git remote # timeout=10 git config --get remote.origin.url # timeout=10 git config -f .gitmodules --get submodule.platforms/android/FolderName.path # timeout=10 using GIT_ASKPASS to set credentials Bitbucket for ParentProject git submodule update --init --recursive platforms/android/FolderName # timeout=10
尽管子模块代码已成功克隆,这个警告的常见原因有以下几种:
子模块URL配置错误:检查
.gitmodules文件里子模块的url字段,确认是否用了Bitbucket的网页浏览URL而非仓库克隆URL(正确格式应为git@bitbucket.org:xxx/xxx.git或https://bitbucket.org/xxx/xxx.git);另外如果URL包含空格、特殊字符,或者相对路径不符合Jenkins解析逻辑,也会触发该警告。Jenkins凭证关联不完整:虽然构建时使用了父项目的Bitbucket凭证,但子模块仓库可能需要单独权限配置。Jenkins在预检查子模块URL路径时,未正确使用凭证访问Bitbucket,导致误判路径不存在,但后续
git submodule update操作通过凭证继承等方式完成了克隆。.gitmodules与本地路径不匹配:
.gitmodules里的path字段和本地实际子模块路径存在拼写、大小写差异,Jenkins初始化阶段校验路径对应关系时触发警告,但后续update操作仍找到正确路径完成克隆。Git插件版本bug:旧版本Jenkins Git插件在解析Bitbucket仓库路径时存在逻辑缺陷,会误报“路径不存在”但不影响实际克隆,升级至最新版Git插件可尝试解决。
内容的提问来源于stack exchange,提问作者L.Learner
相关产品推荐
相关产品推荐

