I’m writing frontend in Java and need a fast DI (Spring, you’re out)
So I picked Dagger
I decided to get a feel of Dagger. I cloned this Baeldung project, built the dagger
module (tutorials.di-modules.dagger
), ran the DaggerUnitTest
. It passed, but the IDE was none the wiser about Dagger’s generated sources, such as DaggerVehiclesComponent
the generated source file’s identifier is colored in red
I can simply add target.generated-sources.annotations
as another source route
the aforementioned directory added as a source route
it’s then colored as expected in the directory tree
But I very much doubt it’s how I’m supposed to do it (when different types of directories intersect, it feels wrong)
Here’s what my Annotation processors
settings look like
annotation processors settings for the parent
annotation processor settings for the dagger module itself
This question’s answers seem to suggest exactly that
So how do I make IntelliJ aware of Dagger’s generated sources (the right way)?