Best Practice CXF Wsdl2Java

I am currently using cxf 2.4.0, and my code is the calling user web service. I was able to create java files on the client side using the cxf plugin in Maven. My question is what is the best practice for generated files? Should I compile the generated files and pack the generated class files into a single jar file or include all created Java files in the build path?

+5
source share
3 answers

I get CXF to generate the code under the target, it selects target / generated-sources / cxf by default, which is good for me. (If you use xjc to process the schema, it uses a similar schema. Maven is great for conventions!)

What I sometimes do is generated code in my own maven module, which can sometimes simplify things; Eclipse is not entirely happy with the generated code (he doesn't like the fact that cleaning up removes the source code from under his feet), so removing it from view makes things a lot easier. In the end, it's just a library that is created from a WSDL document ...

+1
source

"" "main" (main/src/java - main/generated/java), CXF . "" .

0

Create a build task (ant / maven) that generates code and packs the compiled code into a jar file. When wsdl changes, you only need to restart the build task.

If you decide to generate a source, use the Generated annotation . Most wsdl generation tools have this option.

0
source

All Articles