Gradle编译失败问题汇总

2023-10-30

Gradle编译失败问题汇总

问题1(Could not resolve org.springframework.boot:spring-boot-gradle-plugin:3.0.0)

A problem occurred configuring root project 'clickIn'.
> Could not resolve all files for configuration ':classpath'.
   > Could not resolve org.springframework.boot:spring-boot-gradle-plugin:3.0.0.
     Required by:
         project : > org.springframework.boot:org.springframework.boot.gradle.plugin:3.0.0
      > No matching variant of org.springframework.boot:spring-boot-gradle-plugin:3.0.0 was found. The consumer was configured to find a runtime of a library compatible with Java 8, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '7.5.1' but:
          - Variant 'apiElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.0.0 declares a library, packaged as a jar, and its dependencies declared externally:
              - Incompatible because this component declares an API of a component compatible with Java 17 and the consumer needed a runtime of a component compatible with Java 8
              - Other compatible attribute:
                  - Doesn't say anything about org.gradle.plugin.api-version (required '7.5.1')
          - Variant 'javadocElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.0.0 declares a runtime of a component, and its dependencies declared externally:
              - Incompatible because this component declares documentation and the consumer needed a library
              - Other compatible attributes:
                  - Doesn't say anything about its target Java version (required compatibility with Java 8)
                  - Doesn't say anything about its elements (required them packaged as a jar)
                  - Doesn't say anything about org.gradle.plugin.api-version (required '7.5.1')
          - Variant 'mavenOptionalApiElements' capability org.springframework.boot:spring-boot-gradle-plugin-maven-optional:3.0.0 declares a library, packaged as a jar, and its dependencies declared externally:
              - Incompatible because this component declares an API of a component compatible with Java 17 and the consumer needed a runtime of a component compatible with Java 8
              - Other compatible attribute:
                  - Doesn't say anything about org.gradle.plugin.api-version (required '7.5.1')
          - Variant 'mavenOptionalRuntimeElements' capability org.springframework.boot:spring-boot-gradle-plugin-maven-optional:3.0.0 declares a runtime of a library, packaged as a jar, and its dependencies declared externally:
              - Incompatible because this component declares a component compatible with Java 17 and the consumer needed a component compatible with Java 8
              - Other compatible attribute:
                  - Doesn't say anything about org.gradle.plugin.api-version (required '7.5.1')
          - Variant 'runtimeElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.0.0 declares a runtime of a library, packaged as a jar, and its dependencies declared externally:
              - Incompatible because this component declares a component compatible with Java 17 and the consumer needed a component compatible with Java 8
              - Other compatible attribute:
                  - Doesn't say anything about org.gradle.plugin.api-version (required '7.5.1')
          - Variant 'sourcesElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.0.0 declares a runtime of a component, and its dependencies declared externally:
              - Incompatible because this component declares documentation and the consumer needed a library
              - Other compatible attributes:
                  - Doesn't say anything about its target Java version (required compatibility with Java 8)
                  - Doesn't say anything about its elements (required them packaged as a jar)
                  - Doesn't say anything about org.gradle.plugin.api-version (required '7.5.1')

原因
Gradle的版本是7.5.1,它绑定的JDK版本是8,但是spring-boot-gradle-plugin:3.0.0要求JDK版本是17以上。所以要把Gradle绑定的JDK版本升级一下。
我用的是IDEA自带的Gradle,所以升级方法是在配置里找到Gradle,把JDK改为17。

问题2(Failed to resolve imported Maven)

org.gradle.api.GradleException: Failed to resolve imported Maven boms: Could not find org.springframework.cloud:spring-cloud-dependencies:2022.0.0-RC2.
Searched in the following locations:
  - https://maven.aliyun.com/repository/public/org/springframework/cloud/spring-cloud-dependencies/2022.0.0-RC2/spring-cloud-dependencies-2022.0.0-RC2.pom

这是我配置的maven仓库地址

repositories {
    maven {
        url 'https://maven.aliyun.com/repository/public/'
    }
    mavenLocal()
    mavenCentral()
}

原因
https://maven.aliyun.com/repository/public/仓库下找不到spring-cloud-dependencies:2022.0.0-RC2这个bom。去阿里云的maven后台【跳转】参考搜索一下版本所在的仓库,发现是在grails-core仓库下面,所以再添加https://maven.aliyun.com/repository/grails-core仓库配置。

repositories {
    maven {
        url 'https://maven.aliyun.com/repository/public/'
    }
    // 新增
    maven {
        url 'https://maven.aliyun.com/repository/grails-core'
    }
    mavenLocal()
    mavenCentral()
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Gradle编译失败问题汇总 的相关文章

随机推荐

  • uniapp小程序分享功能onShareAppMessage函数传参数

    1 使用onShareAppMessage函数 在页面的js文件中定义了 onShareAppMessage 函数时 页面可以表示该页面可以转发 可以在函数中设置页面转发的信息 1 只有定义了该函数 小程序右上角的菜单中才会有转发按钮 2
  • 短视频seo矩阵系统开发者源码打包

    foreach video list as item item video num material model gt getMaterialCountByVideo item dv id 1 item audio num material
  • 在Mac/win10上将Python 3设置为默认

    which python3 alias python usr bin python3 pip3同理 pip3更换为国内镜像 pip3 config set global index url https pypi tuna tsinghua
  • 程序员11月书讯

    10月书讯中奖名单 iorilan 极简 逆流的鱼yuiop mlcjq Marksinoberg 好书推荐 在图灵书讯中选出你认为值得推荐的好书加推荐理由或推荐语 在文末评论里回复 下期书讯更新时 会在本期的书讯评论中选出若干优秀评论 获
  • 一个完整的软件项目管理流程包括什么?有什么软件项目管理工具?

    软件项目管理全流程 及各环节方法 辅助工具 项目的类型不同 其流程必然会不一样 关于通用项目管理的流程其他回答讲述已经非常完善 个人推荐这篇 泛项目管理流程包括哪些 这里就不再赘述 这里要分享的是关于软件项目管理的流程是什么样的 以及我们使
  • 突发!ChatGPT之父警告AI可能灭绝人类,350名AI权威签署联名公开信

    外链图片转存失败 源站可能有防盗链机制 建议将图片保存下来直接上传 img Xij9fMAd 1685974950524 C Users lenovo AppData Local Temp ksohtml3116 wps1 jpg 就在刚刚
  • 多标记学习(大大杂烩,有点乱)

    多标记学习算法 算法分类 按相关性划分 一阶 first order 策略 该类策略通过逐一考察单个标记而忽略标记之间的相关性 如将多标记学习问题分解为 个独立的二类分类问题 从而构造多标记学习系统 该类方法效率较高且实现简单 但由于其完全
  • Unity导入FBX动画文件

    给刚入门的同学稍微记一下fbx格式动画导入unity的步骤 首先直接把fbx文件拖入unity内 如图操作 将avatar骨骼创建之后 我们接下来就根据自己对动画的一些需求设置一下动画的参数 比如截取一下动画的开始帧和结束帧来达到剪切的目的
  • 使用vue实现幻灯片

    1 在父组件中
  • JS事件循环机制(event loop)之宏任务/微任务

    原文地址 Tasks microtasks queues and schedules 视频讲解地址 https www bilibili com video av83625811 from search seid 6644038259868
  • 测试磁盘寻道时间

    分析性能时 文件系统读取速度不定 主要因为时间不仅花在读取上 还花在磁盘旋转和寻道上 写了一段代码测试这个的时间 一般普通硬盘是10ms左右 有两个函数 第一个函数是生成50G数据 第二个函数是测试 package WebGis Tile
  • OPTICS 点云聚类算法 (附python代码)

    OPTICS Ordering Points To Identify the Clustering Structure 和DBSCAN Density Based Spatial Clustering of Applications wit
  • QObject::connect: Cannot queue arguments of type ‘XXX‘

    1 开发环境 Win10 64bit Qt5 4 2 64bit 2 错误描述 在不同线程之间通过信号 槽来传递自定义数据类型QList
  • jmeter基本教程

    目录 1 简述 2 下载安装 3 基础设置 Jmeter的语言切换 修改Jmeter默认编码为utf 8解决控制台乱码 4 编写项目测试脚本 4 1 添加线程组 4 2 添加测试接口 4 3 添加察看结果树 4 4 添加用户自定义变量 4
  • QTHelprModule.dll 是什么

    QTHelperModule dll 是一个 Windows 平台上的动态链接库 DLL 文件 它通常是某些软件的一部分 用于执行特定的功能和服务 该文件可能包含代码 资源和数据 可以被其他应用程序调用 以实现不同的功能 如果您的系统出现了
  • 物联网:用python调入机器学习分析物联网数据入侵检测模块

    要使用Python调用机器学习分析物联网数据入侵检测模块 您需要以下步骤 安装Python和相关的机器学习库 如scikit learn pandas numpy等 您可以使用pip命令来安装这些库 准备输入数据 这些数据可以是来自物联网设
  • CentOS7 使用minikube 搭建kubernetes 学习环境

    Windows 10 系统 VirtualBox 6 0 x CentOS7启动在虚拟机上 先要安装docker 官网 https docs docker com engine install 有guide 一步步下来很简单 不多说了 按照
  • Python 之 格式化输出

    欢迎大家扫码关注我的微信公众号 Python 格式化输出 目录 一 为何需要进行格式化输出 二 格式化输出的几种方式 2 1 使用 进行格式化 2 1 1 字符串的格式化 2 1 2 浮点数的格式化 2 2 使用 format 进行格式化
  • DFRobot新推出一款适合短时间环境数据记录的Gravity 串口数据记录器

    著名开源硬件商DFRobot新推出一款Gravity 串口数据记录器 适用于做科学记录或短时间环境数据记录 Gravity 串口数据记录器产品特性 1 Gravity 串口数据记录器相比 MicroSD卡 读卡器模块存储数据 可以更方便的存
  • Gradle编译失败问题汇总

    Gradle编译失败问题汇总 问题1 Could not resolve org springframework boot spring boot gradle plugin 3 0 0 A problem occurred configu