Compilation does not find symbols in a jar that is in the compile configuration dependency

Hi, I am not able to find a way to solve this issue and I could not find an answer in the forum.

I have a mult-project build and my build scripts are very simple, with a plugin setting most of the dependencies. The specific error is this

/Users/me/devel/TreasureBoat/Frameworks/Private/TBEnterprise/Sources/com/webobjects/eoaccess/ error: cannot find symbol
			qualifier = qualifiers.firstObject();

But the required jar is in the class path. I have a task to see the compile configuration dependencies and the specific jar is indeed there:

task dumpCompile << {
	configurations.compile.each {
	    println "compile: $it"

This task results in a lot of dependencies and the one that holds the missing firstObject() method is there in the cache:

compile: /Users/me/.gradle/caches/modules-2/files-2.1/com.webobjects/JavaFoundation/5.4.3/6191ef7ea159a277387ed430f23593aa1a9f9ee3/JavaFoundation-5.4.3.jar

I can’t see what I am missing, since three other sub-projects are built correctly?

My platform as reported by gradle:

Groovy:       2.3.10
Ant:          Apache Ant(TM) version 1.9.4 compiled on April 29 2014
JVM:          1.8.0_45 (Oracle Corporation 25.45-b02)
OS:           Mac OS X 10.10.3 x86_64


Is that the only error?

I’d check…

  • imports (are you importing the correct class?). You can probably check this via the IDE
  • versions (are the other project’s using JavaFoundation 5.4.3?). You can check with gradle dependencies.
  • is it an earlier error (e.g., qualifier is not defined?)

Hi Sterling

  • Imports: checked (Eclipse correctly points to the method)
  • Versions: checked (the required dependencies are there and are shown with gradle dependencies)
  • No previous error: checked (qualifier is defined)
  • The error persists: checked

Additionally, Eclipse builds the frameworks where Gradle fails.

There are other 56 errors like this one, methods missing from the classes in the jar. Using javap I am able to see that the classes and the methods are there, but the compiler doesn’t find them.

Hrm… is the Eclipse classpath generated by Gradle?

Are there any other projects that also use JavaFoundation (any version)?

This is my first attempt with Gradle with real world development after reading two books. I intend to migrate all my development to Gradle and Eclipse and in this case I may be following the wrong path, since I am manually (mainly in an effort to deepen my understanding of Gradle) creating the build scripts, without importing the Eclipse project. Another reason why I did not import the Eclipse project is that I will modify the directories layout to adhere to Gradle convention. I will change the project layout after I have it built with Gradle.

When I issue gradle tbenterprise:build --debug I can see that the classpath is properly set up. The Eclipse and Gradle class paths are essentially the same.

Yes, another project uses TBFoundation.