Hi all,

A tip for those using Maven that use the code generation plugin is to put 
the plugin in its own profile and have it only activate
when the generated-sources directory is missing.

    <profile>
      <id>jooq</id>
      <activation>
        <!-- trick to disable constant jooq generation -->
        <file>
          <missing>${basedir}/target/generated-sources</missing>
        </file>
      </activation>
      <build>
        <plugins>
         <!-- flyway plugin -->
         <!-- jooq plugin -->
         </plugins>
       </build>
     </profile>

Now I realize not everyone generates the classes on every build and might 
prefer checking  in the classes but we like to generate the classes after 
running the flyway migration scripts.

The only caveat now is that developers must run a "mvn clean" if they want 
to rerun the code generation which typically  happens anyway when a 
developer pulls. It also will always happen on the build machine since the 
build machine starts from scratch anyway.

The way we roughly structure our maven projects is to alway have a 
multimodule project. Then we make a jooq module that only has the flyway 
plugin and migration scripts and the jooq code generator plugin. No other 
code. Then other modules depend on the jooq module. This works pretty well.

-- 
You received this message because you are subscribed to the Google Groups "jOOQ 
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to