Hi, I need to control the way generated sources are compiled when running WSDLToJava. The reason for that comes from the need of running the tool in-container on JBoss AS 7, which has a full modular classloading and does not rely on java.endorsed.dirs env prop for overriding JAXWS api in JDK (6) and always use JAXWS 2.2 apis. I've managed to do that by using the Java Compiler API to write a small extension of javax.tools.ForwardingJavaFileManager that I can successfully pass to the CompilationTask which is called in org.apache.cxf.common.util.Compiler::useJava6Compiler(String[] file) . My JavaFileManager properly controls the way the compiler retrieve classes' bytecode so that JAXWS stuff is loaded from JBoss modules instead of directly from the JDK boot classpath.
Now, I'm looking for a proper way to extend the CXF WSDLToJava tool for configuring the java6 compiler, iow allowing me to pass in the JavaFileManager mentioned above; I currently see 2 options: 1) allow extending org.apache.cxf.common.util.Compiler class and setting an instance of it into the ToolContext that's passed to WSDL2Java; org.apache.cxf.tools.common.ClassUtils would check for provided instance of Compiler and use that if available, otherwise the current Compiler will still be created and used; I would then provide into the ToolContext my extension of cxf Compiler that uses my JavaFileManager 2) pass a ForwardingJavaFileManager builder (interface to be defined) into the ToolContext, add a member into Compiler for storing that and let org.apache.cxf.tools.common.ClassUtils set it; the builder will then be used to create the ForwardingJavaFileManager instance given the StandardJavaFileManager computed in Compiler::useJava6Compiler(...) . Do you see any other option / have any suggestion? I would likely go for 1 if nobody has preferences. Thanks Alessio -- Alessio Soldano Web Service Lead, JBoss
