问题遇到的现象和发生背景
刚学习gradle,尝试使用gradle classes对源文件进行编译,报错
settings.gradle和build.gradle已经添加阿里云仓库
问题相关代码,请勿粘贴截图
- What went wrong:
Plugin [id: 'org.springframework.boot', version: '2.3.5.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.3.5.RELEASE')
Searched in the following repositories:
Gradle Central Plugin Repository
maven(https://maven.aliyun.com/repository/gradle-plugin)
我的解答思路和尝试过的方法
build.gradle文件内容
plugins {
id 'org.springframework.boot' version '2.3.5.RELEASE'
id 'io.spring.dependency-management' version '1.0.12.RELEASE'
id 'java'
}
group = 'com.atguigu'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '1.8'
repositories {
mavenLocal()
maven {
allowInsecureProtocol = true
name "Alibaba" ;
url "https://maven.aliyun.com/repository/public" }
maven {
allowInsecureProtocol = true
name "Bstek" ;
url "https://nexus.bsdn.org/content/groups/public/" }
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
}
tasks.named('test') {
useJUnitPlatform()
}
setting.gradle文件内容
pluginManagement {
repositories {
gradlePluginPortal()
maven {
allowInsecureProtocol = true
url "https://maven.aliyun.com/repository/gradle-plugin" }
}
}
rootProject.name = 'demo'