idea 使用gradle 构建 报can't resolve symbol 'mavenBom'

图片说明

试一下File->Invalidate Caches/Restart 清除缓存重启 还不行就maven -> Reinport

到mvnrepository查看Finchley.M1的gradle compile
http://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-dependencies/Finchley.M1

// https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-dependencies
compile group: 'org.springframework.cloud', name: 'spring-cloud-dependencies', version: 'Finchley.M1', ext: 'pom'

同时发现spring-cloud-starter-config、spring-cloud-starter-eureka的compile也是错的
修改build.gradle

group 'com.cloud'
version '1.0-SNAPSHOT'
buildscript {
ext {
springBootVersion = '1.5.6.RELEASE'
}
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}
apply plugin: 'java'
apply plugin: 'spring-boot'
sourceCompatibility = 1.8
repositories {
maven {
url 'https://repo.spring.io/libs-milestone'
}
}
dependencies {
compile group: 'org.springframework.cloud', name: 'spring-cloud-dependencies', version: 'Finchley.M1', ext: 'pom'
compile group: 'org.springframework.cloud', name: 'spring-cloud-starter-config', version: '2.0.0.M1'
compile group: 'org.springframework.cloud', name: 'spring-cloud-starter-eureka', version: '2.0.0.M1'
}