Gradle:在任务':stage'上找不到属性'installDist'

时间:2015-10-02 22:00:46

标签: gradle

我的root项目中有一个build.gradle,如下所示:

apply plugin: 'application'
apply plugin: 'java'

sourceCompatibility = 1.8

repositories {
    mavenCentral()
}

allprojects {

    repositories {
        mavenCentral()
    }

    dependencies {
        //....etc
    }
}

mainClassName = "com.website.Main"
task stage {
    dependsOn installDist
    println "Running Stage"
}

task wrapper(type: Wrapper) {
    gradleVersion = '2.7' //version required
}

然而,当我运行gradle stage时,我得到了:

* What went wrong:          
A problem occurred evaluating root project 'root-module'.
> Could not find property 'installDist' on task ':stage'.

奇怪的是,如果我运行.\gradlew stage它运行正常......为什么会这样?

0 个答案:

没有答案