这是对 this post 的跟进.我在 gradle
中有一个小示例项目涉及一个 scala
文件,它无法在我的新机器上构建(它曾经在相同的硬件上工作 + debian stretch
):
$ gradle build
:compileJava UP-TO-DATE
:compileScala FAILED
FAILURE: Build failed with an exception.
* What went wrong:
A problem was found with the configuration of task ':compileScala'.
> No value has been specified for property 'zincClasspath'.
我的build.gradle
文件如下:
version = 0.1
apply plugin: 'scala'
repositories {
mavenCentral()
}
dependencies {
compile 'org.scala-lang:scala-library:2.11.8'
}
我当前的 gradle 版本是:
$ gradle -version
------------------------------------------------------------
Gradle 3.2.1
------------------------------------------------------------
Build time: 2012-12-21 00:00:00 UTC
Revision: none
Groovy: 2.4.8
Ant: Apache Ant(TM) version 1.9.9 compiled on March 1 2017
JVM: 1.8.0_121 (Oracle Corporation 25.121-b13)
OS: Linux 4.8.0-1-amd64 amd64
我的 scala
(和 scalac
)版本是 2.11.8。我正在使用 debian stretch
:
$ uname -a
Linux front 4.8.0-1-amd64 #1 SMP Debian 4.8.5-1 (2016-10-28) x86_64 GNU/Linux
我想了一会儿缺少依赖项(常见的故障源)并检查安装任何可能相关的 gradle
包(例如 libgradle-plugins-java
) 但这并没有解决问题。
如有任何建议,我们将不胜感激。
最佳答案
对我来说,这个问题通过切换到更新的 gradle 消失了。现在到 4.9:
gradle wrapper --gradle-version=4.9
然后使用./gradlew
(或gradlew.bat
)代替gradle。
(作为记录,我在使用 gradle 2.10 时遇到了这个问题,这是 Ubuntu 16.04 的默认设置)
关于scala - Gradle 任务 :compileScala fails on missing value for zincClasspath,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43039340/