Now, the querydsl stuff brought in by the :jpa does a great job of generating my class files. The way it works is it bypasses generating *.java and goes directly to *.class. This is awesome.
Now, when i include project(":myappEntity") in the dependencies of project B, project B can’t find the resulting Q classes.
With what you’ve posted, both the *.java and *.class file are generated into the classes directory and included in the jar / on the classpath.
For the curious, doodad = Annotation Processor
Taking what you have, I added an example entity in the entity project and usage of it in a “project B”, both directly copied and pasted from the querydsl website and everything works as expected (minus the additional, but non-breaking inclusion of the *.java file).
Considering the most basic example project with querydsl extrapolated from your post works, you might be overlooking something impactful that’s not actually querydsl related.
second look, your right about the java files. i did find a way to dump them into a generated folder, but i don’t care, i don’t want them in source control anyways. the compile project(":myappEntity") in the dependencies of project B is supposed to include the output of myappEntity right? If thats the case, im not sure why nothing else can see those class files.
The JAR file built for myAppEntity should contain the Q*.class files for each @Entity you have in the project. Using your configuration from the first post, I can grab an example entity from anywhere, add it to the project, and see the Q*.java and Q*.class files generated and included in the JAR. I can also reference the Q* classes in project B.
I’m taking “nothing else” to mean absolutely nothing that could consume these files. I am considering project B to be something else. I’m ignoring IntelliJ for now. If you’re really saying that you can’t even compile project B with references to the Q* classes, something is fundamentally wrong that needs to be addressed before focusing on anything more complicated.
Even if you want the generated files to stay out of source control, you will likely need to isolate them for the IntelliJ case since IntelliJ needs to separately be able to work with these files. I don’t think it’s worth looking at this until it’s the only problem remaining though.
I don’t think you’ve provided enough information for a third party to identify your current issue. My sample project with your snippets doesn’t seem to have the same problem. See it works for you and if that helps point out what is fundamentally different in your project or points out a relevant point to add to continue the discussion.