# Integrating Spring Boot + QueryDSL into Gradle Build

**URL:** <https://discuss.gradle.org/t/integrating-spring-boot-querydsl-into-gradle-build/15421>\
**Category:** Help/Discuss\
**Tags:** plugins\
**Created:** [March 24, 2016, 11:33pm UTC](https://discuss.gradle.org/t/integrating-spring-boot-querydsl-into-gradle-build/15421 "2016-03-24T23:33:22Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Tom\_Hartwell](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/tom_hartwell/32/646_2.png) [@Tom\_Hartwell](https://discuss.gradle.org/u/Tom_Hartwell)\
**Post date:** [March 24, 2016, 11:48pm UTC](https://discuss.gradle.org/t/integrating-spring-boot-querydsl-into-gradle-build/15421/2 "2016-03-24T23:48:00Z")

</div>

Interesting, I’ve been working on this for a couple of hours I was able to swap out

```gradle
compileJava {
    classpath = configurations.runtime + configurations.querydslapt
    options.compilerArgs = [
            "-proc:only",
            "-processor", "com.mysema.query.apt.jpa.JPAAnnotationProcessor"
    ]
    destinationDir = sourceSets.generated.java.srcDirs.iterator().next()
}

```

with

```gradle
task generateQueryDSL(type: JavaCompile, group: 'build', description: 'Generates the QueryDSL query types') {
    source = sourceSets.main.java
    classpath = configurations.compile + configurations.querydslapt
    options.compilerArgs = [
            "-proc:only",
            "-processor", "com.mysema.query.apt.jpa.JPAAnnotationProcessor"
    ]
    destinationDir = sourceSets.generated.java.srcDirs.iterator().next()
}

compileJava {
    dependsOn generateQueryDSL
    source generateQueryDSL.destinationDir
}

compileGeneratedJava {
    dependsOn generateQueryDSL
    classpath += sourceSets.main.runtimeClasspath
}

```

Wish I knew a bit more about Gradle to know why these are different, if you’ve got an inkling, would love to hear it for my own edification. This fixed the problem I’m now able to build and bootRun my Spring Boot application

---

_[View the full topic](https://discuss.gradle.org/t/integrating-spring-boot-querydsl-into-gradle-build/15421)._
