On 2010-01-31, KARR, DAVID (ATTCINW) <dk0...@att.com> wrote: > I don't know if this is an Ant-specific problem, or an issue with the > OpenJPA PCEnhancerTask class.
I don't have any experience with the later, so I can't really say. > I have an Ant build script whose "build" target has "compile, > enhance-classes" as an excerpt from its dependencies. The "compile" > target writes classes to "build/classes", and "enhance-classes" > references a classpath variable that specifies build/classes as one of > the path elements. > When I'm doing incremental development, without doing "ant clean" at any > point, everything works fine. The build script compiles new changes and > the enhancer enhances the domain classes and everything deploys and runs > fine. > If I instead do an "ant clean", then "ant compile", and then "ant", > everything also works fine. > However, if I do "ant clean", and then "ant", the "compile" step > finishes, and then the "enhance-classes" target fails because it can't > find certain classes that the "compile" step should have compiled. This sounds as if there was some classloader involved that cached information. Ant's own ClassLoader usually doesn't, but it extends URLClassloader. I know that for some JDKs Java used to drop directories from classloaders that don't exist when the classloader is created. Can you perform an Ant clean, manually create build/classes and then run "ant"? If this works, then it really means the directory has been dropped. If it doesn't work, then we need to investigate where you create the <path> (and see whether you can defer creating it) and if any other tasks use it. Stefan --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@ant.apache.org For additional commands, e-mail: user-h...@ant.apache.org