I'm using Spring Data for a webserver project I'm working on. For my build tool I'm using Gradle, and I'm trying to integrate QueryDSL to be able to write dynamic queries in my application against my database (MongoDB if it matters). I have a few questions about setting up my environment correctly:
1) Upon integrating QueryDSL, I noticed that some of my build steps started failing. Specifically, there are 2 build steps called compileQuerydslJava
and findbugsQuerydsl
(the latter being from the FindBugs plugin) which are failing. Based on the error messages, it seems that the QueryDSL-generated files are not able to be picked up by the requisite engines. Specifically, for findbugsQuerydsl
, the error I'm getting looks like this:
> Task :my-service:findbugsQuerydsl FAILED
No files to be analyzed
For compileQuerydslJava, the error looks like this:
> Task :message-service:compileQuerydslJava FAILED
C:\MY_PATH\QMyEntity.java:3: error: package com.querydsl.core.types does not exist
import static com.querydsl.core.types.PathMetadataFactory.*;
If I exclude those build steps using the -x flag, everything works fine, the code compiles and runs without an issue. However, I'm a bit reticent to count that as the optimal solution; presumably these tools were developed properly and should be able to be configured to work properly, so I'm wondering what I'm missing.
2) Another developer on my team checked out this code and tried to run it, but the QueryDSL generated classes weren't being automatically created for him. It caused him compile errors in the application until he ran a gradle build
. I'd rather this not be standard practice, and for the required Querydsl files to be generated automatically, like a library. Is there a way to do this? Or at least to have the files generated at compile time so it doesn't cause compile errors?
I'm not sure what information is helpful to debug this, so please ask any questions that would be helpful to help me. Thanks.
EDIT:
1) For reference, my Querydsl version is 4.1.4. I am aware this isn't the most recent version but it was the version used in the tutorial I used to set up Querydsl. If recommended I can try 4.2.1.