解决“Caused by: org.gradle.api.plugins.UnknownPluginException: Plugin with id 'org.springframework.boot' not found.”

升级老项目spring boot 和 cloud版本之后 gradle clean 报错:“Caused by: org.gradle.api.plugins.UnknownPluginException: Plugin with id 'org.springframework.boot' not found.”

 

原来的build.gradle 中是这样的:

buildscript {
ext {
springBootVersion = '2.1.6.RELEASE'
}
repositories {
mavenCentral()

mavenLocal()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}

 修改:

去掉 mavenLocal()

这个函数会优先查找本地本地的maven仓库,按照这个顺序查找依赖:USER_HOME/.m2/settings.xml >> M2_HOME/conf/settings.xml >> USER_HOME/.m2/repository

而我本地这个文件夹并没有springboot的最新版本依赖,所以会提示找不到sringboot



posted @ 2019-07-15 14:51  高圈圈  阅读(31272)  评论(0编辑  收藏  举报