What is a good strategy for dealing with generated code? One of our projects uses Apache CXF's wsdl2java tool to generate JAX-WS stubs for a set of wsdls. How should this code be dealt with?
There are two options that I can see:
Generate the stubs once and store them in version control. With this, you don't have to deal with IDE classpath issues since you have the source files right there in your tree (or nearby). However, you have a lot of extra clutter in version control in addition to the temptation for someone to monkey with the generated code
The stubs are generated every time at build time. This reverses the pros/cons for #1 in that the developer now has to deal run the build script and add the resulting jars to his/her classpath.
We went with #2 because the annoyance of classpath related issues seemed to outweigh the problems detailed in #1.
What are other people doing? Does anyone have any recommendations to streamline this process?