[英]Could not set unknown property 'mainClassName' for root project
I am writing a spark application. 我正在写一个火花应用程序。 With the following
build.gradle
file, I am getting an error as stated in the title when syncing gradle in Intellij Idea. 使用以下
build.gradle
文件,我在Intellij Idea中同步gradle时收到标题中所述的错误。
plugins {
id 'java'
}
sourceCompatibility = 1.8
mainClassName = 'HelloSpark'
repositories {
mavenCentral()
}
dependencies {
....
}
This is because the property mainClassName
is introduced by the gradle plugin application
. 这是因为gradle插件
application
引入了属性mainClassName
。 Adding the application
plugin fixed the error: 添加
application
插件修复了错误:
plugins {
id 'java'
id 'application'
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.