0

I am building groovy classes under my src/main/groovy dir and I build them and the .class files are under build/classes, but when I run the code it does not see those classes.

What do I have to do to make those files be seen?

Al B
  • 101
  • 2
  • 4

1 Answers1

0

If your src and build directories are in a component directory you can have the build file either put the classes in the /classes directory or put them in a jar file in the /lib directory. You can also put class files and other classpath resources in the runtime/classes directory or in a jar file in the runtime/lib directory.

The Moqui classloader adds these to the classpath automatically at runtime.

David E. Jones
  • 1,721
  • 1
  • 9
  • 8
  • Thanks. So the default output.classesDir is /build/classes, but classes in there do not make it into the classpath - right? I changed that by putting: sourceSets.main.output.classesDir = file(projectDir.absolutePath + '/classes' ) in build.gradle. To change the destinationDir for the jar files, in the "jar" task I put: jar {...destinationDir = file(projectDir.absolutePath + '/lib' ) – Al B Aug 07 '14 at 11:09