Querydsl in eclipse not generating query type classes

1,553 views
Skip to first unread message

Brian Schupbach

unread,
Nov 9, 2016, 3:18:17 PM11/9/16
to Querydsl
I've been over the instructions and for the life of me can't get the classes to be generated. Is there something I'm missing? From my pom.xml

<!-- querydsl used for creating generic query builder for reporting -->
<dependency> 
   <groupId>com.mysema.querydsl</groupId> 
   <artifactId>querydsl-core</artifactId> 
   <version>3.6.0</version>
</dependency> 
<dependency> 
   <groupId>com.mysema.querydsl</groupId> 
   <artifactId>querydsl-apt</artifactId> 
   <version>3.6.0</version>
</dependency>
<!--<dependency>
  <groupId>com.mysema.querydsl</groupId>
 <artifactId>querydsl-hql</artifactId>
 <version>1.8.2</version>
</dependency>--> 
<dependency> 
   <groupId>com.mysema.querydsl</groupId> 
   <artifactId>querydsl-jpa</artifactId> 
   <version>3.6.0</version> 
</dependency> 
<dependency>
       <groupId>org.springframework.data</groupId>
       <artifactId>spring-data-jpa</artifactId>
       <version>1.9.0.RELEASE</version>
   </dependency>
<!-- end querydsl -->

......


<plugin>
     <groupId>com.mysema.maven</groupId>
     <artifactId>apt-maven-plugin</artifactId>
     <version>1.0.9</version>
     <executions>
       <execution>
         <goals>
           <goal>process</goal>
         </goals>
         <configuration>
           <outputDirectory>target/generated-sources/java</outputDirectory>
           <processor>com.mysema.query.apt.hibernate.JPAAnnotationProcessor</processor>
           <options>
             <querydsl.entityAccessors>true</querydsl.entityAccessors>
           </options>          
         </configuration>
       </execution>
     </executions>
   </plugin>


Brian Schupbach

unread,
Nov 15, 2016, 8:13:02 PM11/15/16
to Querydsl
I still cannot generate the Q classes...if anyone has any help, it would be greatly appreciated. Below are methods I've tried and snippets from my pom.xml file

I've copied suggested plugin setup located here:

https://github.com/querydsl/apt-maven-plugin/wiki/m2e-usage

http://stackoverflow.com/questions/24482259/eclipse-issue-with-maven-build-and-jdk-when-generating-qclasses-in-querydsl
http://stackoverflow.com/questions/24482259/eclipse-issue-with-maven-build-and-jdk-when-generating-qclasses-in-querydsl

I've gone to the project folder and ran mvn generate-sources and added the folder to the classpath. Still, the project cannot find any Q classes that are generated and I do not see any generated within the target folder. If anyone has any insights, I would be greatly appreciative. Thanks

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry exported="true" kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry exported="true" kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v8.0">
<attributes>
<attribute name="owner.project.facets" value="jst.web"/>
</attributes>
</classpathentry>
<classpathentry exported="true" kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="target/generated-sources"/>
<classpathentry kind="src" path="src/main/webapp/WEB-INF/tld"/>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>





<properties>
 
<java-version>1.8</java-version>
 
<maven.compiler.source>1.8</maven.compiler.source>
   
<maven.compiler.target>1.8</maven.compiler.target>
 
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
 
<querydsl.version>3.7.4</querydsl.version>
 
 
</properties>
 
 
<dependencyManagement>
   
<dependencies>
       
<dependency>
           
<groupId>org.springframework</groupId>
           
<artifactId>spring-framework-bom</artifactId>
           
<version>4.2.5.RELEASE</version>
           
<type>pom</type>
           
<scope>import</scope>
       
</dependency>
   
</dependencies>
 
</dependencyManagement>


 
<dependencies>
 
<!--  <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context</artifactId>
    </dependency>-->

   
   
<dependency>
       
<groupId>org.springframework</groupId>
       
<artifactId>spring-web</artifactId>
   
</dependency>
   
   
<dependency>
       
<groupId>org.springframework</groupId>
       
<artifactId>spring-orm</artifactId>
   
</dependency>
   
 
<dependency>
       
<groupId>org.springframework</groupId>
       
<artifactId>spring-context</artifactId>
   
</dependency>
   
   
<dependency>
       
<groupId>org.springframework</groupId>
       
<artifactId>spring-tx</artifactId>
   
</dependency>
   
   
 
<!-- web services -->
 
<dependency>
       
<groupId>org.springframework.ws</groupId>
       
<artifactId>spring-ws-core</artifactId>
       
<version>2.2.4.RELEASE</version>
   
</dependency>
   
   
<!-- security -->
   
<dependency>
       
<groupId>org.springframework.security</groupId>
       
<artifactId>spring-security-web</artifactId>
       
<version>4.0.4.RELEASE</version>
   
</dependency>
   
   
<dependency>
 
<groupId>org.springframework.security</groupId>
 
<artifactId>spring-security-taglibs</artifactId>
 
<version>4.0.4.RELEASE</version>
 
</dependency>
 
 
<dependency>
 
<groupId>org.springframework.security</groupId>
 
<artifactId>spring-security-config</artifactId>
 
<version>4.0.4.RELEASE</version>
 
</dependency>
 
 
<!-- HDIV SECURITY
  <dependency>
      <groupId>org.hdiv</groupId>
      <artifactId>hdiv-core</artifactId>
      <version>2.1.3</version>
  </dependency>
 
  <dependency>
      <groupId>org.hdiv</groupId>
      <artifactId>hdiv-config</artifactId>
      <version>2.1.3</version>
  </dependency>
 
  <dependency>
      <groupId>org.hdiv</groupId>
      <artifactId>hdiv-spring-mvc</artifactId>
      <version>2.1.3</version>
  </dependency>
 
  <dependency>
      <groupId>org.hdiv</groupId>
      <artifactId>hdiv-jstl-taglibs-1.2</artifactId>
      <version>2.1.3</version>
  </dependency>-->

 
 
<dependency>
   
<groupId>org.hibernate</groupId>
   
<artifactId>hibernate-core</artifactId>
   
<version>5.1.0.Final</version>
 
</dependency>
 
 
<dependency>
 
<groupId>org.hibernate</groupId>
 
<artifactId>hibernate-validator</artifactId>
 
<version>5.2.4.Final</version>
 
</dependency>


 
<dependency>
 
<groupId>mysql</groupId>
 
<artifactId>mysql-connector-java</artifactId>
 
<version>5.1.38</version>
 
</dependency>


 
<!-- https://mvnrepository.com/artifact/org.springframework.data/spring-data-commons-core
 <dependency>
    <groupId>org.springframework.data</groupId>
    <artifactId>spring-data-commons-core</artifactId>
    <version>1.4.1.RELEASE</version>
 </dependency>-->

   
   
<!--  <dependency>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-releasetrain</artifactId>
            <version>Gosling-SR4</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>-->

   
   
<dependency>
 
<groupId>javax.mail</groupId>
 
<artifactId>javax.mail-api</artifactId>
 
<version>1.5.5</version>
 
</dependency>
 
 
<dependency>
 
<groupId>org.json</groupId>
 
<artifactId>json</artifactId>
 
<version>20160212</version>
 
</dependency>
 
 
<dependency>
 
<groupId>io.jsonwebtoken</groupId>
 
<artifactId>jjwt</artifactId>
 
<version>0.6.0</version>
 
</dependency>
 
   
<dependency>
 
<groupId>log4j</groupId>
 
<artifactId>log4j</artifactId>
 
<version>1.2.17</version>
 
</dependency>




 
<dependency>
 
<groupId>commons-io</groupId>
 
<artifactId>commons-io</artifactId>
 
<version>2.4</version>
 
</dependency>
 
 
<dependency>
 
<groupId>org.apache.commons</groupId>
 
<artifactId>commons-lang3</artifactId>
 
<version>3.4</version>
 
</dependency>
 
 
<dependency>
 
<groupId>org.apache.commons</groupId>
 
<artifactId>commons-email</artifactId>
 
<version>1.4</version>
 
</dependency>
 
     
<!-- JSON -->
 
<dependency>
 
<groupId>com.fasterxml.jackson.core</groupId>
 
<artifactId>jackson-core</artifactId>
 
<version>2.7.4</version>
 
</dependency>


   
<dependency>
 
<groupId>com.fasterxml.jackson.core</groupId>
 
<artifactId>jackson-databind</artifactId>
 
<version>2.7.4</version>
 
</dependency>


 
<dependency>
 
<groupId>com.fasterxml.jackson.core</groupId>
 
<artifactId>jackson-annotations</artifactId>
 
<version>2.7.4</version>
 
</dependency>


   
<dependency>
 
<groupId>com.fasterxml.jackson.datatype</groupId>
 
<artifactId>jackson-datatype-hibernate5</artifactId>
 
<version>2.7.4</version>
 
</dependency>


 
<dependency>
 
<groupId>com.fasterxml.jackson.datatype</groupId>
 
<artifactId>jackson-datatype-jdk8</artifactId>
 
<version>2.7.4</version>
 
</dependency>
 
 
<dependency>
 
<groupId>org.modelmapper</groupId>
 
<artifactId>modelmapper</artifactId>
 
<version>0.7.5</version>
 
</dependency>
 
 
 
<!--  
 <dependency>
 <groupId>com.fasterxml.jackson</groupId>
 <artifactId>jackson-datatype-json-org</artifactId>
 <version>1.8.0</version>
 </dependency>
 
 <dependency>
 <groupId>org.codehaus.jackson</groupId>
 <artifactId>jackson-mapper-asl</artifactId>
 <version>1.9.13</version>
 </dependency>-->

 
   
<!-- SMS and voice calls
    <dependency>
    <groupId>com.twilio.sdk</groupId>
    <artifactId>twilio-java-sdk</artifactId>
    <version>3.4.5</version>
 </dependency>-->

   
   
<dependency>
   
<groupId>javax.servlet</groupId>
   
<artifactId>jstl</artifactId>
   
<version>1.2</version>
 
</dependency>
 
 
<!-- https://mvnrepository.com/artifact/joda-time/joda-time -->
 
<dependency>
   
<groupId>joda-time</groupId>
   
<artifactId>joda-time</artifactId>
   
<version>2.9.4</version>
 
</dependency>
 
   
<!-- aws IoT -->
 
<dependency>
   
<groupId>com.amazonaws</groupId>
   
<artifactId>aws-iot-device-sdk-java</artifactId>
   
<version>1.0.1</version>
 
</dependency>
 
 
<dependency>
   
<groupId>com.amazonaws</groupId>
   
<artifactId>aws-iot-device-sdk-java-samples</artifactId>
   
<version>1.0.1</version>
 
</dependency>


 
<!-- https://mvnrepository.com/artifact/com.amazonaws/aws-java-sdk-dynamodb -->
 
<dependency>
   
<groupId>com.amazonaws</groupId>
   
<artifactId>aws-java-sdk-dynamodb</artifactId>
   
<version>1.11.33</version>
 
</dependency>
 
 
<dependency>
 
<groupId>com.github.derjust</groupId>
 
<artifactId>spring-data-dynamodb</artifactId>
 
<version>4.3.1</version>
 
</dependency>


 
<!-- https://mvnrepository.com/artifact/org.springframework/spring-context-support -->
 
<dependency>
   
<groupId>org.springframework</groupId>
   
<artifactId>spring-context-support</artifactId>
 
</dependency>
   
 
<!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient -->
 
<dependency>
   
<groupId>org.apache.httpcomponents</groupId>
   
<artifactId>httpclient</artifactId>
   
<version>4.5.2</version>
 
</dependency>
 
 
<dependency>
   
<groupId>javax.servlet</groupId>
   
<artifactId>javax.servlet-api</artifactId>
   
<version>3.1.0</version>
 
</dependency>
 
 
 
<!-- Querydsl -->


     
<dependency>
         
<groupId>com.mysema.querydsl</groupId>
         
<artifactId>querydsl-apt</artifactId>
         
<version>${querydsl.version}</version>

     
</dependency>
     
<dependency>
         
<groupId>com.mysema.querydsl</groupId>

         
<artifactId>querydsl-jpa</artifactId>
         
<version>${querydsl.version}</version>
     
</dependency>
 
 
<!-- persistence -->

     
<dependency>
         
<groupId>org.springframework.data</groupId>
         
<artifactId>spring-data-jpa</artifactId>
         
<version>1.9.0.RELEASE</version>
     
</dependency>

     
<dependency>
         
<groupId>org.hibernate</groupId>
         
<artifactId>hibernate-entitymanager</artifactId>
         
<version>5.1.0.Final</version>
     
</dependency>
 
<!--
 <dependency>
    <groupId>io.springfox</groupId>
    <artifactId>springfox-swagger2</artifactId>
    <version>2.3.1</version>
 </dependency>
 
  <dependency>
        <groupId>org.webjars</groupId>
        <artifactId>bootstrap</artifactId>
        <version>3.3.5</version>
    </dependency>
       <dependency>
        <groupId>io.springfox</groupId>
        <artifactId>springfox-swagger-ui</artifactId>
        <version>2.2.2</version>
    </dependency>
 -->

           
<!-- -AWS
 <dependency>
 <groupId>com.amazonaws</groupId>
 <artifactId>aws-java-sdk-iot</artifactId>
 <version>1.10.62</version>
 </dependency>
 
 <dependency>
 <groupId>com.amazonaws</groupId>
 <artifactId>aws-java-sdk-core</artifactId>
 <version>1.10.64</version>
 </dependency>


 <dependency>
 <groupId>com.amazonaws</groupId>
 <artifactId>aws-java-sdk-machinelearning</artifactId>
 <version>1.10.64</version>
 </dependency>-->

           
 
<!-- reporting
 <dependency>
  <groupId>ar.com.fdvs</groupId>
  <artifactId>DynamicJasper</artifactId>
  <version>5.0.7</version>
 </dependency>-->

 
</dependencies>
 
.....
<plugins>
               
<plugin>
                   
<groupId>org.apache.maven.plugins</groupId>
                   
<artifactId>maven-war-plugin</artifactId>
                   
<version>2.4</version>
                   
<configuration>
                       
<warSourceDirectory>src/main/webapp</warSourceDirectory>
                       
<warName>webmanager</warName>
                       
<failOnMissingWebXml>false</failOnMissingWebXml>
                   
</configuration>
               
</plugin>
               
<plugin>
 
<groupId>org.apache.maven.plugins</groupId>
 
<artifactId>maven-compiler-plugin</artifactId>
 
<configuration>
 
<source>1.8</source>
 
<target>1.8</target>
 
</configuration>
 
</plugin>

 
<plugin>
 
<groupId>com.mysema.maven</groupId>
 
<artifactId>apt-maven-plugin</artifactId>

 
<version>1.0.5</version>

 
<executions>
   
<execution>
     
<goals>
       
<goal>process</goal>
     
</goals>
     
<configuration>
       
<outputDirectory>target/generated-sources/java</outputDirectory>

       
<processor>com.mysema.query.apt.jpa.JPAAnnotationProcessor</processor>
     
</configuration>
   
</execution>
 
</executions>
 
<dependencies>

   
<dependency>
     
<groupId>com.mysema.querydsl</groupId>
     
<artifactId>querydsl-apt</artifactId>

     
<version>${querydsl.version}</version>

   
</dependency>
   
<dependency>
     
<groupId>com.mysema.querydsl</groupId>

     
<artifactId>querydsl-jpa</artifactId>
     
<classifier>apt</classifier>
     
<version>${querydsl.version}</version>
   
</dependency>
 
</dependencies>
 
</plugin>
 
<plugin>
 
<groupId>org.codehaus.mojo</groupId>
 
<artifactId>build-helper-maven-plugin</artifactId>
 
<executions>
   
<execution>
     
<id>add-source</id>
     
<phase>generate-sources</phase>
     
<goals>
       
<goal>add-source</goal>
     
</goals>
     
<configuration>
       
<sources>
         
<source>${project.build.directory}/generated-sources/java/</source>
       
</sources>
     
</configuration>
   
</execution>
 
</executions>
 
</plugin>
           
</plugins>

Reply all
Reply to author
Forward
0 new messages