Gradle tasks are disabled in eclipse
Asked Answered
S

2

5

I'm trying to create a .jar file for my eclipse project. Through export option, I am able to create .jar, but I want to use Gradle build task to do so. Problem is that, all tasks are disabled for this particular project only, as showing in the following image...

Gradle Tasks

For another project, these Gradle tasks are working fine. See its build.gradle file...

apply plugin : 'eclipse'
apply plugin: 'java-library'

repositories {
    jcenter()
    mavenCentral()
}

dependencies {
    compile group:"org.apache.pdfbox", name:"pdfbox", version:"2.0.6"
    compile group:"org.apache.pdfbox", name:"pdfbox-tools", version:"2.0.6"
    compile 'com.google.code.gson:gson:2.8.2'
    compile 'org.json:json:20180130'

    api 'org.apache.commons:commons-math3:3.6.1'

    implementation 'com.google.guava:guava:21.0'

    testImplementation 'junit:junit:4.12'
}

It's settings.gradle file contains a single line that is...

rootProject.name = 'schedule-extractor'

Can anybody suggest what I am missing here?

Secularity answered 8/6, 2018 at 5:31 Comment(2)
unrelated to your question, but the current version of PDFBox is 2.0.9.Quattrocento
I've tried with that alsoSecularity
B
6

Have you check this buildship's issue: https://github.com/eclipse/buildship/issues/511

The following comment resolved it for me (I was having the same problem) : https://github.com/eclipse/buildship/issues/511#issuecomment-367392031

For those who had a similar problem in include builds - Check the file .setting/org.eclipse.buildship.core.prefs whether the connection.project.dir property is empty. If not, make it empty. In my case the grayed tasks become green again.

Bonkers answered 19/2, 2019 at 20:11 Comment(1)
For nested projects I need to set the property to the location of the parent project, e.g. connection.project.dir=../..Ake
S
0

In my case, It happened when I was using composite build concept of Gradle. According to this approach, One build could be dependent on another build. In this case, the projects may behave like this.

For example, have a look on my composite build setup in settings.gradle...

rootProject.name = 'BackendRESTServices'
includeBuild ('../Algorithms') 
includeBuild ('../Utilities')

Now I won't be able to build Algorithms & Utilities projects from Gradle Tasks tab as shown in the attached image of question.

Secularity answered 13/7, 2020 at 12:5 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.