在idea中使用gradle构建项目时总是提示失败,发现报错信息如下:
1 2 3 4 5 6 |
Warning:project ':common': Unable to build Scala project configuration Details: org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all files for configuration ':common:scalaCompiler'. Caused by: org.gradle.internal.resolve.ModuleVersionResolveException: Could not resolve org.scala-lang:scala-compiler:2.11.8. Required by: project :common Caused by: org.gradle.internal.resolve.ModuleVersionResolveException: No cached version of org.scala-lang:scala-compiler:2.11.8 available for offline mode. |
看了一下,关键是最后一行:
1 |
No cached version of org.scala-lang:scala-compiler:2.11.12 available for offline mode. |
印象中并没有设置过离线模式。看了一下idea中gradle的设置,发现存在相关的默认设置“Offline work”。取消勾选“Offline work”就可以了。
依次打开如下菜单:
Settings -> Build.Execution,Deployment -> Build Tools –> Gradle
在Globle Gradle settings中有“Offline work”项,取消掉勾选就可以了。
#######
1 |
发表评论