我正在使用带有querydsl-4.1.4的Kapt版本3 . 以下是我的 build.gradle 文件:

buildscript {
    ext {
        kotlinVersion = '1.2.41'
        springBootVersion = '2.0.2.RELEASE'
    }
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
        classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlinVersion}")
        classpath("org.jetbrains.kotlin:kotlin-allopen:${kotlinVersion}")
    }
}

apply plugin: 'java'
apply plugin: 'kotlin'
apply plugin: 'kotlin-spring'
apply plugin: 'eclipse'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
apply plugin: 'kotlin-kapt'

group = 'com.example.package'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = 1.8

kapt {
    generateStubs = true
    mapDiagnosticLocations = true
}

compileKotlin {
    kotlinOptions {
        freeCompilerArgs = ["-Xjsr305=strict"]
        jvmTarget = "1.8"
    }
}

compileTestKotlin {
    kotlinOptions {
        freeCompilerArgs = ["-Xjsr305=strict"]
        jvmTarget = "1.8"
    }
}

repositories {
    mavenCentral()
}


dependencies {
    kapt 'com.querydsl:querydsl-apt:4.1.4:jpa'

    compile('org.springframework.boot:spring-boot-starter-data-jpa')
    compile('org.springframework.boot:spring-boot-starter-web')
    compile('org.springframework.boot:spring-boot-starter-webflux')
    compile('org.springframework.boot:spring-boot-starter-websocket')
    compile('com.fasterxml.jackson.module:jackson-module-kotlin')
    compile("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
    compile("org.jetbrains.kotlin:kotlin-reflect")
    testCompile('org.springframework.boot:spring-boot-starter-test')
    testCompile('io.projectreactor:reactor-test')
    compile("com.querydsl:querydsl-jpa:4.1.4")
    compile('commons-dbcp:commons-dbcp:1.2.2')
    compile('com.machinezoo.noexception:noexception:1.3.2')
    compile('org.apache.commons:commons-lang3:3.7')
    compile('com.google.code.gson:gson:2.8.2')
}

构建过程正确执行而没有错误,但不生成querydsl q类 . 我按照kotlin-example build.gradle示例,但没有任何反应 . 此外,我在许多网站上搜索了一个可能的解决方案并尝试了许多不同的解决方案......但没有 .