Gradle Eclipse-WTP is missing dependencies even though command line Gradle is not missing dependencies

I hope you are able improve the Eclipse WTP integration soon. Although Gradle on the command line works great, we really need Eclipse to work properly with Gradle in order to use Gradle at all. So far, it has been one troubling issue after another which prevents Gradle from being used by my team. We are struggling to determine if we can even use Gradle at all on our main projects if Eclipse cannot publish Gradle’s dependencies correctly.

Earlier issues: https://github.com/spring-projects/spring-boot/issues/1276#issuecomment-49586527 https://github.com/spring-projects/eclipse-integration-gradle/issues/44 I sort of worked around those issues by manually modifying Eclipse classpath.

kdvolder closed my issue with the Gradle plugin because he thinks it is a duplicate of another issue - I don’t - but regardless these issues make Gradle completely not useable with Ecplise. We need the most popular Java IDE to be able to generate a correct classpath with Gradle or we cannot use Gradle.

kdvolder says these issues below are the blocking issues. It would be great if some action would be taken on these issues. I don’t understand why if this information is available to the command line gradle, why isn’t it available to the tooling API? How is the tooling API supposed to be used to duplicate what the command line of Gradle does if the information is not exposed? http://issues.gradle.org/browse/GRADLE-1777 https://issuetracker.springsource.com/browse/STS-2380

== Current issue - Eclipse-WTP won’t load the dependencies == In any case, I’m now trying to do some very basic things such as loading the latest Spring examples with Gradle using the Eclipse Gradle tooling from Spring with Eclipse-WTP to publish and debug. However, Eclipse WTP cannot publish many of the gradle dependendencies. The dependencies seem to be identified within Eclipse because I’m not getting compilation issues. However, what is published to the wtpwebapps directory is missing dependencies.

I’m just trying to do a couple of the current basic Spring.io examples. from http://spring.io/guides/gs/rest-hateoas/

My current project: http://activecookbook.com/gradle_issue/fs2014.zip What exclipse wtp outputs from my project: http://activecookbook.com/gradle_issue/fs2014_wtpwebapps_output.zip

The spring hateoas jar and other jars are not published by Eclipse-WTP.

spring-hateoas-0.14.0.RELEASE.jar

I get this error of course because the spring-hateoas-0.14.0.RELEASE.jar was not published by Eclipse-WTP: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘greetingController’ defined in file [/Users/beyondenergy/Documents/DevFocus/DavidOliver/software/servers/apache-tomcat-8.0.9/wtpwebapps/fs2014/WEB-INF/classes/hello/GreetingController.class]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: org/springframework/hateoas/ResourceSupport

My build.gradle looks like this: buildscript {

repositories {

maven { url “http://repo.spring.io/libs-release” }

mavenLocal()

mavenCentral()

}

dependencies {

classpath(“org.springframework.boot:spring-boot-gradle-plugin:1.1.4.RELEASE”)

} }

apply plugin: ‘java’ apply plugin: ‘eclipse-wtp’ apply plugin: ‘idea’ apply plugin: ‘spring-boot’ apply plugin: ‘war’

war {

baseName = ‘gs-serving-web-content’

version = ‘0.1.0’ }

eclipse {

wtp {

facet {

facet name: ‘jst.web’, version: ‘3.1’

facet name: ‘java’, version: ‘1.8’

facet name: ‘wst.jsdt.web’, version: ‘1.0’

}

} }

repositories {

mavenLocal()

mavenCentral()

maven { url “http://repo.spring.io/libs-release” } }

configurations {

providedRuntime }

dependencies {

compile(“org.springframework.boot:spring-boot-starter-thymeleaf”)

providedRuntime(“org.springframework.boot:spring-boot-starter-tomcat”)

compile(“org.springframework.boot:spring-boot-starter-web”)

compile(“com.fasterxml.jackson.core:jackson-databind”)

compile(“org.springframework.hateoas:spring-hateoas”)

compile(“org.springframework.plugin:spring-plugin-core:1.1.0.RELEASE”)

compile(“com.jayway.jsonpath:json-path:0.9.1”)

testCompile(“org.springframework.boot:spring-boot-starter-test”)

testCompile(“junit:junit”) }

task wrapper(type: Wrapper) {

gradleVersion = ‘2.0’ }