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

从外部仓库复制后Foundry代码仓库检查失败原因排查

问题与解决方案

问题情况

通过Windows Git命令行将代码从旧仓库迁移到新仓库,执行步骤为:git clone $old_repo → 复制文件到新仓库目录 → git push $new_repo。在master分支及其所有派生分支执行检查时,触发如下错误:

A problem occurred evaluating root project. 
    > Failed to apply plugin 'com.palantir.transforms-defaults'. 
    > ChecksException: 
       (TransformsGradlePlugin:NoProjectVersionSet):
        {hint=No project version was set, possibly because there are no git tags., project=clinical-trials-anonymised-repo}

原因分析

com.palantir.transforms-defaults插件依赖Git标签自动生成项目版本号,但迁移过程仅复制了代码文件,未同步旧仓库的Git标签,新仓库无有效标签导致插件无法确定版本。

修复方法

方法一:同步Git标签

  1. 从旧仓库拉取所有标签到本地:
    git fetch $old_repo --tags
    
  2. 将本地标签推送到新仓库:
    git push $new_repo --tags
    
  3. 重新执行检查任务即可。

方法二:手动指定版本

若无需依赖Git标签管理版本,可在项目根目录的build.gradle文件中手动设置版本号,示例:

version = "1.0.0" // 替换为实际需要的版本号

内容的提问来源于stack exchange,提问作者Max Magid

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.22 09:02:09