Groovy build fails with "unable to resolve class" when run via TeamCity, works locally


(Corrado) #1

Hello, it’s the second day I’m after this problem and really I’m out of ideas now.

I have a project, and one module of which uses exclusively Groovy. My build script simply applies the groovy plugin and imports dependencies. It’s made only of two classes, a superclass and a subclass. The compilation of the subclass fails by stating that the superclass can’t be found.

/opt/TeamCity/buildAgent/work/290c560ddde02920/LambdaPhantom/src/main/groovy/co/urbi/lambda/bikemi/BikemiRegistration.groovy: 3: unable to resolve class co.urbi.lambda.PhantomJSTask 
 @ line 3, column 1. 
   import co.urbi.lambda.PhantomJSTask 
   ^ 
1 error 

The strange thing is that the same commit builds fine locally (Windows env) but fails in the TeamCity (Centos Linux). I am totally unsure about this being a Gradle problem or a TeamCity problem, but I tried to run the build from command line on the CI server and it fails with the same error, therefore excluding TeamCity from the equation.

I have attached the output of the command in the two env (with --info) here

Local env (successful) http://pastebin.com/VKhiq2Dc
CI env (failing) http://pastebin.com/n7mRHY9E

The project setup

Any help is welcome.


(Sterling Greene) #2

It sounds like it might be a case sensitivity problem.

Try looking at the source files on the CI server and see if you have any in the “wrong” directory (e.g., one in src/main/groovy and one in Src/Main/Groovy).


(Corrado) #3

Sterling, thanks a lot for your reply. You gave me an hint that in the end helped me find the riddle.

Following your suggestion I diffed the source tree and found that a file was missing. The cause was indeed a case-sensitive issue, but on the .gitignore file, which was matching a source file on Windows.

I overlooked it since I was sure it was a sourceSets kind of problem.

So, thanks a lot, this made my day better!

All the best,
Corrado