Sadly the question does not really have the needed information to answer it completely. But I can tell the following. If you make a directory ./com/something/ and out A.groovy and B.groovy in there and then compile them using the commandline groovyc ./com/something/A.groovy ./com/something/B.groovy
, then this must work. So far the directory is not really important, but that changes if you change to groovyc ./com/something/B.groovy
, because now groovyc has to "discover" A.groovy and requires the correct directory structure for this.
Now, how the ant, gradle and maven version of groovyc normally work is by supplying a complete list of sources. If this is not done, compilation may fail. But if the root directories for A and B are different and you do not give both to the compiler, then it will surely fail.
I cannot know if that is the reason, so I want this answer more understood as a pointer to what might be wrong. Hope this helps