Gradle Core Plugins (plugin is not in 'org.gradle' namespace)

记录一个由 gradle 构建项目遇到的问题:

起因:项目原先运行正常,不过个人 移除掉默认仓库  .gradle 仓库后,重新拉取报错如下:

FAILURE: Build failed with an exception.

* Where:
Build file 'F:\ideaSpace\insuranceService\build.gradle' line: 13

* What went wrong:
Plugin [id: 'org.springframework.boot', version: '2.2.4.RELEASE'] was not found in any of the following sources:

- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Plugin Repositories (could not resolve plugin artifact 'org.springframework.boot:org.springframework.boot.gradle.plugin:2.2.4.RELEASE')
  Searched in the following repositories:
    Gradle Central Plugin Repository

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 0s
19:10:18: Task execution finished 'clean'.

这是 build.gradle 文件的内容

buildscript {
	repositories {
		maven {
			url "http://maven.aliyun.com/nexus/content/groups/public"
		}
		maven {
			url 'https://maven.aliyun.com/repository/gradle-plugin'
		}
	}
}

plugins {
	id 'org.springframework.boot' version '2.2.4.RELEASE'
	id 'io.spring.dependency-management' version '1.0.9.RELEASE'
	id 'java'
}

网上查询大多说是插件引用不对:

以下罗列出找到的2个方法(针对我的项目都无法解决,期望对查阅者有帮助),还有第三种,是摸索出来的,可解决(请各位对症下药)

第一种:修改插件引用形式

https://blog.triplez.cn/err-and-solution-of-config-gradle-idea-env/

第二种:下载插件引用不到的情况

* What went wrong:
A problem occurred configuring root project 'MyApp'.
> Could not resolve all files for configuration ':classpath'.
   > Could not download jimfs.jar (com.google.jimfs:jimfs:1.1)
      > Could not get resource 'https://plu

https://www.codercto.com/a/50093.html

第三种:需要查看你本地用的JDK,是 一般的JDK 还是 OpenJDK, 如果是用OpenJDK,请切换到一般的JDK,,并把项目目录下的 .idea 内 workspace.xml 删除 , 并把项目 clean (不能clean,则手动移除项目目录下生成的构建包 .build 、 .gradle、out )

关闭重启,重新拉取,就OK。

原因具体不太清楚,OpenJDK 安装在 mac电脑 可以直接拉取,在windows环境,经常会错出这类错误

  • 3
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值