I'm using Maven to build and deploy jOOQ. I now want to start generating XJC-generated classes using appropriate Maven plugins (before, I used ant scripts). This works very nicely for me, but I'm afraid that some users wanting to build jOOQ themselves without Maven will now have trouble generating those missing sources. So I'd like to move those sources out of target/generated-sources/xjc
and into src/main/java
, in order to be able to put them under version control.
src/main/java
)?Note, the underlying XSD hardly ever changes, so I don't have to generate these sources every time I build...
This is a terrible idea, you should never put generated sources in version control because whatever they are being generated from can change, and then your code is out of sync.
Even if the XSD never changes, note I said never, not hardly ever, as you said, which is different, I would not put the sources under version control. Maven can be told to not generate the sources every time if the XSD hasn't changed.
If you go down the Maven route, then anyone building your stuff should use the same tool chain. This is not specific to Maven. If this was Ant, or a C++ project with a make file, you wouldn't want to do this either.
If you really want to provide a Maven free stand alone distribution, then have Maven generate that, there are plenty of plugins that will export all the artifacts as an archive that you can distribute. But don't compromise your build for some nebulous external requirement that may not exist.