Could not find method eclipse() for arguments

Hello,

I am using eclipse and I added in the build.gradle the following lines to download the source code of the jars

> eclipse {
>     classpath {
>         downloadJavadoc = true
>         downloadSources = true
>     }
> }

After adding the lines, I get the following error when I run the gradle refresh dependencies:


* Where:
Build file '/home/skydog/gitRep001/FS0003/build.gradle' line: 27

* What went wrong:
A problem occurred evaluating root project 'FS0003'.
> Could not find method eclipse() for arguments [build_592ro702nkql2ks12u3nm5ou4$_run_closure2@5040726e] on root project 'FS0003'.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

Does anybody know which is the issue? Eclipse should download the source code without problems
This is the build.gradle script:


apply plugin: 'java'
apply plugin: 'war'
apply plugin: 'maven'
apply plugin: 'spring-boot'

buildscript {
    repositories {
        mavenCentral()
    }

    dependencies {
        classpath("org.springframework.boot:spring-boot-gradle-plugin:1.2.2.RELEASE")
      
    }
}

repositories {

    mavenLocal()
    mavenCentral()

    maven {
        url "http://dl.bintray.com/ethereum/maven"
    }
}

eclipse {
    classpath {
        downloadJavadoc = true
        downloadSources = true
    }
}

configurations.all {
    // check for updates every build
    resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}

dependencies {
    compile ("org.springframework.boot:spring-boot-starter-web")


    compile "com.google.guava:guava:18.0"
    compile ("org.ethereum:ethereumj-core:1.0.0-RC1"){

        exclude group: "log4j"
        exclude group: "org.slf4j", module: "log4j-over-slf4j"
        exclude group: "org.slf4j", module: "slf4j-log4j12"

    }
        
}

sourceSets {
    main {
        java {
            srcDir './src'
        }
    }
}

task wrapper(type: Wrapper) {
    gradleVersion = '2.2.1'
}

task stage {
    dependsOn bootRepackage
}

bootRun {
    jvmArgs = ["-server", "-Xms3g", "-Dethereumj.conf.file=/home/skydog/eclipse_workspace/FS0003/Dethereumj.conf"]
}

Hi
You miss the
apply plugin: 'eclipse’
plug-in declaration before your eclipse block declaration

Hi Francois, thanks a lot!