Generated sources by JOOQ are not being compiled when skipping JOOQ

时间:2019-03-19 14:42:27

标签: java maven jooq

We use spring boot and Jooq together in our project, and we are setting a Gitlab CI/CD process with build, test, deploy phases.

We found that Jooq can be a bit challenging when setting up the CI/CD process since we have to spin up a dockerized db specifically to run jooq.

Basically, our steps in the build phase in Gitlab CI are:

  • Spin up a dockerized db
  • Execute flyway: mvn flyway:migrate ...
  • Run mvn package -DskipTests (which runs jooq to generate the code)
  • Cache target/

So far so good, however the next CI/CD job is the Test phase, where we do:

  • Pull target/ from cache
  • Run mvn test -DskipJooq=true

Since mvn package already executed jooq to generate sources the problem we have is that when calling mvn test -DskipJooq=true JOOQ does not do anything, but we still need jooq to compile the generated java files.

I couldn't find anything related to this. Is there any way to achieve that?

For the moment, we solved this by spinning up the db, running flyway and jooq again in the test phase (the same process we have in build phase), but this looks like unnecessary if we could make jooq to compile the generated sources.

0 个答案:

没有答案