IntelliJ excludes jooqCodegen's folder
Answered
Using kotlin + gradle (gradle wrapper 8.5) + JooqCodegen (gradle plugin 3.19.6)
JOOQ generates model objects from the database schema in directory `build/generated-sources/jooq`
Unfortunately IntelliJ marks that folder as Excluded …
So I tried right-click > Mark Directory as … > Generated Sources Root with no success… (directory is now blue, but imports are still unresolved).
Of course everything compiles just fine using ./gradlew clean build
Using: IntelliJ IDEA 2023.3.6 (Ultimate Edition)
Build #IU-233.15026.9, built on March 21, 2024
Please sign in to leave a comment.
I've created a minimal project to reproduce:
https://github.com/jobayle/repro-intellij-imports
Thanks!
Problem solved by using gradle plugin
idea
:Problem solved by using gradle plugin idea:
This cannot really considered as a solution. I don't find clean put IDE's plugins in projects files…
Another way is to manually include the sourceSet as below. (I tried this with your project and Ultimate 2024.1.1).
Now IDEA automatically un-excludes
build/generated-sources/jooq
, without having to directly configure the IDEA plugin.See https://github.com/jOOQ/jOOQ/issues/16088 for some discussion around this.
I suppose because
./gradlew build
succeeds JOOQ-codegen-gradle is doing something with the sourceSets … it's just that IDEA is not able to pick up on it for some reason. This is a bit perplexing: one would think that it if gradle knew, IDEA should also know after importing the model.PS. I modified your project slightly to not need a real DBMS environment by using ‘XMLDatabase' … https://www.jooq.org/doc/3.19/manual/code-generation/codegen-xml/
Thank you to everyone reporting on this!
I have created YouTrack Issue IDEA-354580 based on the information from this thread and assigned to the R&D Team, so this issue can be addressed.
Please make sure to upvote the YouTrack Issue to raise its' priority for the developers!
There's a discussion about jOOQ's source set management here:
https://github.com/jOOQ/jOOQ/issues/16318#issuecomment-2162576930