为了看eureka源码,从github上clone下了eureka项目。eureka在github上面的项目是gradle项目,平时使用的maven比较多,gralde基本上没有接触过,clone下来之后,用idea2018破解版import project之后,导入配置出错,因为gradle在导入这两个plugin时,id 'nebula.netflixoss' version '8.8.1' id 'org.gretty' version '2.1.0',报not fount error,看了几种网上的解决方法,一个是在build.gradle脚本的buildScript和subProject的repositories里添加阿里云maven仓库地址,try,无效。另一种,clone gralde plugin的gradle-netflixoss-project-plugin工程,将resources和main下文件拷贝到eureka的resources下,再使用gradle重新导入,这一次,没有报not found error了,在Build model 'org.jetbrains.plugins.gradle.model.GradleExtensions' for root project 'eureka' 这步时,提示java.lang.NoClassDefFoundError: org/gradle/api/internal/plugins/DefaultConvention,类找不到。根据github上gradle的issues讲的,是idea版本太低导致,换成高版本就不存在了。于是乎,高高兴兴下载了idea 2021.03community。好了,又报
Could not resolve all artifacts for configuration ':classpath'.
> Could not resolve com.netflix.nebula:gradle-extra-configurations-plugin:2.2.+.
Required by:
project :
> Could not resolve com.netflix.nebula:gradle-extra-configurations-plugin:2.2.2.
> Could not get resource 'https://plugins.gradle.org/m2/com/netflix/nebula/gradle-extra-configurations-plugin/2.2.2/gradle-extra-configurations-plugin-2.2.2.pom'.
> Could not HEAD 'https://plugins.gradle.org/m2/com/netflix/nebula/gradle-extra-configurations-plugin/2.2.2/gradle-extra-configurations-plugin-2.2.2.pom'.
> Connect to plugins.gradle.org:443 [plugins.gradle.org/104.18.190.9, plugins.gradle.org/104.18.191.9] failed: Read timed out
> Could not resolve gradle.plugin.org.gretty:gretty:2.1.0.
Required by:
project : > org.gretty:org.gretty.gradle.plugin:2.1.0
> Skipped due to earlier error
> Could not resolve gradle.plugin.nl.javadude.gradle.plugins:license-gradle-plugin:0.14.0.
Required by:
project : > nebula.netflixoss:nebula.netflixoss.gradle.plugin:8.8.1 > com.netflix.nebula:gradle-netflixoss-project-plugin:8.8.1
> Skipped due to earlier error