title: Gradle 5 QueryDsl Generating Duplicate Classes
body: <p>I am using queryDsl to generate Q classes with Gradle. It used to work fine with Gradle 3.5, but on upgrading to Gradle 5.5.1, it is failing with duplicate class error.</p>
  
  <p>My generateQueryDsl task works fine generating the classes under 'gensrc/' but on compileJava, the classes are generated again under 'build/generated/' which ends up giving duplicate class error.</p>
  
  <pre><code>dependencies { 
  
     api("org.springframework.boot:spring-boot-starter-data-jpa") {
          exclude group: "org.hibernate", module: "hibernate-entitymanager"
          exclude group: "org.hibernate", module: "hibernate-core"
          exclude group: "org.apache.tomcat", module: "tomcat-jdbc"
      }
      api("com.zaxxer:HikariCP:${hikaricpVersion}")
  
      api("com.h2database:h2:1.4.193")
      api("mysql:mysql-connector-java")
      api("com.microsoft.sqlserver:sqljdbc42:6.0.8112")
      api("org.springframework.data:spring-data-jpa")
      api("org.springframework:spring-jdbc")
      api("org.springframework:spring-orm")
      api("org.eclipse.persistence:javax.persistence:${eclipseLinkPersistenceVersion}")
      api("org.eclipse.persistence:eclipselink:${eclipseLinkVersion}")
      api("org.eclipse.persistence:org.eclipse.persistence.jpa:${eclipseLinkVersion}")
  
      api("com.mysema.querydsl:querydsl-sql:${queryDslVersion}")
      api("com.mysema.querydsl:querydsl-jpa:${queryDslVersion}")
      api("com.mysema.querydsl:querydsl-apt:${queryDslVersion}")
  
                 annotationProcessor('com.mysema.querydsl:querydsl-apt:3.7.4:jpa')
                 annotationProcessor("org.springframework.boot:spring-boot-starter-data-jpa")
  
  } 
  
  task generateQueryDSL(type: JavaCompile, group: 'build) {
  
                  source = sourceSets.main.java
                  classpath = configurations.compileClasspath
                  options.annotationProcessorPath = configurations.annotationProcessor
                  destinationDir = file('gensrc/main/java')
  
          }
  
          compileJava {
                  dependsOn generateQueryDSL
          }
  
  error: duplicate class: com.persistence.domain.model.QOrganizationBasedModel
  
  
  
  and likewise for all generated classes
  </code></pre>