2
我跟着這我已經安裝我的build.gradle按照他們的指示,但是當我運行'分級構建'我得到以下錯誤。Rest.li gradle配置錯誤規範未知
'No such property: spec for class:org.gradle.api.internal.project.DefaultProject_Decorated'
我認爲它是指行生成文件 「dataTemplateCompile spec.product.pegasus.data」 ,但我不能確定爲什麼呢?
apply plugin: 'idea'
apply plugin: 'eclipse'
def pegasusVersion = "1.24.1"
spec = [
"product": [
"pegasus": [
"data" : "com.linkedin.pegasus:data:" + pegasusVersion,
"generator" : "com.linkedin.pegasus:generator:" + pegasusVersion,
"restliClient" : "com.linkedin.pegasus:restli-client:" + pegasusVersion,
"restliServer" : "com.linkedin.pegasus:restli-server:" + pegasusVersion,
"restliTools" : "com.linkedin.pegasus:restli-tools:" + pegasusVersion,
"pegasusCommon" : "com.linkedin.pegasus:pegasus-common:" + pegasusVersion,
"restliCommon" : "com.linkedin.pegasus:restli-common:" + pegasusVersion,
"r2" : "com.linkedin.pegasus:r2:" + pegasusVersion,
"restliNettyStandalone": "com.linkedin.pegasus:restli-netty-standalone:" + pegasusVersion
]
]
]
buildscript {
repositories {
mavenCentral()
mavenLocal()
}
dependencies {
classpath group: 'com.linkedin.pegasus', name: 'gradle-plugins', version: '1.15.9'
}
}
subprojects {
apply plugin: 'maven'
apply plugin: 'idea'
apply plugin: 'eclipse'
sourceCompatibility = JavaVersion.VERSION_1_6 // or 1_7
afterEvaluate {
// add the standard pegasus dependencies wherever the plugin is used
if (project.plugins.hasPlugin('pegasus')) {
dependencies {
dataTemplateCompile spec.product.pegasus.data
restClientCompile spec.product.pegasus.restliClient
}
}
}
}
我有同樣的問題,更換的build.gradle文件。但是我可以通過將gradle降級到1.8版來實現它。不知道爲什麼。 – user875367