Reference not found

Hi, I am migrating from Ant to Gradle.

The old build do not have a common LIB folder for all jars. So, the Ant build had several path variables which were later used as per requirement. Ex:

<path id="xyz.lib">
  <fileset dir="someDir">
   <include name="*.jar" />

there are other similar variables.

Now far a particular compile task, the classpathref is set to one of these variables. This works in Ant.

Gardle: I converted each path variable into

def xyz_lib = ant.path{

and later used this attribute in


But during compilation, the build throws “reference jars not found” error.

Can you please guide me what is wrong?

Thanks and Regards, Nishant.


I have also tried by defining path as

ant.path(id: 'xyz_lib'){

and then in ant.javac

ant.javac(....., classpathref = ant.references['xyz_lib'] ,.....)