This might simply be a maven question. I'm just getting started with Dagger 2 which uses javax.annotation.processing to generate sources based on annotations.
When I use my IDE, IntelliJ, and build the project (Build - Rebuild Project) it places the generated sources files (i.e. $$Factory and Dagger_) in:
target/generated-sources/annotations
IntelliJ automatically declares this as a source root so using the generated classes doesn't get marked as an error:
// Dagger_CoffeeApp$$Coffee is a generated class
Coffee coffee = Dagger_CoffeeApp$Coffee.builder().build();
The problem is that if I build from the command line via maven:
mvn clean compile
The generated sources are located in:
target/classes
And thus the files are marked with an error in my IDE. I could probably simply add target/classes as a source root, but ideally I would like compiling from the command line to be consistent with my IDE. Is there some argument to maven to specify which directory the generated sources files are generated in?