Why does jOOQ suggest putting the generated code under "/ target" and not under "/ src"?

Looking at the jooQ example of the Maven plugin configuration for the code generator (near the end of the configuration), I see that the target is a directory for the generated files target/generated-sources/jooq.

Since the generator generates Java code, do you know why the sentence here is not a subfolder /src, but instead a completely separate one? Is there a reason for this? Is it best practice or something like that?

+4
source share
1 answer

This is a good question, and should probably also be included in the jOOQ manual !

The question is not strictly related to jOOQ, but to the generation of the source code in general (for example, also when using XJC to generate JAXB-annotated Java code from XSD). Some people prefer to compile the source code for part of the "main" source code, others prefer to keep it separate. In essence, these ideas underlie each approach:

Saving things separately (e.g. target / generated sources)

  • The only "source of truth" is the database schema. Their copies are never stored in source form, only in binary form.
  • . , (, ), . , .

(, src/main/java)

  • "" .
  • - "" , .
  • , , .
  • , jOOQ.

. .

+4

All Articles