querydsl / apt-maven-plugin

Maven APT plugin
Apache License 2.0
79 stars 41 forks source link

Q classes not being generated. #54

Open MarinKacaj opened 7 years ago

MarinKacaj commented 7 years ago

I'm developing an app with the Apache Isis framework, where I use Query DSL for typesafe JDO queries. My configuration is similar to the one described here. I'm also using com.mysema.query.apt.jdo.JDOAnnotationProcessor for domains annotated with javax.jdo.annotations.PersistenceCapable. Domains are located in directory paths such as dom.domainapp.student.Student, dom.domainapp.subject.Subject, etc.

In configuration options querydsl.suffix and querydsl.prefix are both set to the letter D to avoid conflicts with the Q already used by Apache Isis.

However domain classes are not being generated by Query DSL.

I have also tried running mvn apt:process manually from the command line to no avail.

Maven version: 3.3.3 OS: Windows 10 apt-maven-plugin version: 1.1.3 Apache Isis version: 1.13.1 Query DSL version: 3.7.4

Shredder121 commented 7 years ago

Could you make an example project, that we can inspect and debug?

MarinKacaj commented 7 years ago

This is where I'm experimenting with Query DSL in my sample project. Query DSL is used by the dom module, as configured here. Thanks.

Shredder121 commented 7 years ago

To me it looks like it's working. Although I noticed that nothing happens if JAVA_HOME points to just a JRE instead of a JDK. Could you confirm this?

Also, since the root project doesn't have the apt-maven-plugin bound, calling it from there results in it picking a different one, which indeed notifies me of just a JRE running.

MarinKacaj commented 7 years ago

I checked JAVA_HOME and it was set to the 1.8.060 JDK. Following your finding, I went for apt-maven-plugin. BuildPlan Maven Plugin got me the mapping of goals to lifecycle phases as described here, in Chad Nouis' answer. This is what I got from BuildPlan: apt-maven-plugin | generate-sources | default | process So I added mvn generate-sources as a step before any other step that pertains to Apache Isis. It generated the Q classes (D in my case) just as expected. If necessary I'll look further into the matter. Please let me know. Thank you.

pranav0073 commented 5 years ago

@MarinKacaj thanks this works form me -- mvn generate-source