| It appears the issue is related with parameter dir usage by enhancer plugin. It is used both as base directory to scan for .class files and as a root directory for the ClassPool classloader used by Enhancer. Therefore if I want to limit the scope to enhance the classes by specifying concrete package folder (ex. <dir>${project.build.outputDirectory}/org/acme/entities}</dir>), the class loader gets wrong URL to search classes at and Enhancer fails to obtain the classes from ClassPool when follows associations, it that class was not processed before. Enhancer's ClassLoader should always get the ${project.build.outputDirectory} URL to search for classes. |