Newbi can not run unit tests and application in eclipse


(Davidson) #1

The guy that set up our gradle build is out on vacation.

I am not sure why but I am no longer able to run our junit tests and apps in eclipse. They run fine from the command line. I.E.

$ ./gradlew clean build

In eclipse I get the error bellow. It looks like eclipse is using both the gradle cache and the maven repository. I had this problem a couple of days ago and thought it was a stale jar file problem because removing the gradle cache and maven repository seemed to resolve the problem. Today rm -rf is not able to fix the problem

I have tried

  1. deleting the projects and importing them again into eclipse.
  2. using the gradle refresh all in eclipse.
  3. deleting the ~/.m2/repository and ~/.gradle/cache

Any suggestions would be greatly appreciated.

$ …/gradlew --version


Gradle 2.12

Build time: 2016-03-14 08:32:03 UTC
Build number: none
Revision: b29fbb64ad6b068cb3f05f7e40dc670472129bc0

Groovy: 2.4.4
Ant: Apache Ant™ version 1.9.3 compiled on December 23 2013
JVM: 1.8.0_66 (Oracle Corporation 25.66-b17)
OS: Mac OS X 10.11.4 x86_64

I am using eclipse luna with Gradle IDE eclipse plug in
Gradle IDE 3.7.3.201602250836-RELEASE org.springsource.ide.eclipse.gradle.feature.feature.group Pivotal Software, Inc.

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/Users/anr/.gradle/caches/modules-2/files-2.1/ch.qos.logback/logback-classic/1.1.5/92353eb144695bba80b31f7bec4f36d871f230ac/logback-classic-1.1.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/Users/anr/.m2/repository/org/slf4j/slf4j-log4j12/1.7.10/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
WARN 19:22:49 main o.a.h.u.NativeCodeLoader line:62 Unable to load native-hadoop library for your platform… using builtin-java classes where applicable
SLF4J: Detected both log4j-over-slf4j.jar AND slf4j-log4j12.jar on the class path, preempting StackOverflowError.
SLF4J: See also http://www.slf4j.org/codes.html#log4jDelegationLoop for more details.


(Davidson) #2

I uninstalled Pivotal 's “Gradle IDE eclipse plug” in and installed buildship from the eclipse market place. BuildShip is Gradle.org’s official Gradle support for Eclipse. Buildship is provided by the Eclipse Foundation.

The problem seems to be resolved. I think the maybe the Pivotal plug in might have messed up the eclipse project somehow?

ref:
http://gradle.org/eclipse/


http://www.vogella.com/tutorials/EclipseGradle/article.html