【发布时间】:2020-09-30 09:43:19
【问题描述】:
大家好,我的 bulid.gradle 有一个小问题,我将运行我的项目,但这不可能。有人知道为什么会这样吗? 我收到此错误:
任务“:compileQuerydsl”执行失败。 > 未找到注释处理器''
- 尝试: 使用 --stacktrace 选项运行以获取堆栈跟踪。使用 --info 或 --debug 选项运行以获得更多日志输出。运行 --scan 以获得完整的见解。
Hier 是我的 bulid.gradle 配置
buildscript {
ext {
springBootVersion = '2.3.1.RELEASE'
queryDslVersion = '4.2.1'
}
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
classpath 'org.liquibase:liquibase-core:3.4.1'
classpath "org.liquibase:liquibase-gradle-plugin:1.1.1"
}
}
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "gradle.plugin.com.ewerk.gradle.plugins:querydsl-plugin:1.0.10"
}
}
plugins {
id 'org.springframework.boot' version '2.3.1.RELEASE'
id 'io.spring.dependency-management' version '1.0.9.RELEASE'
id 'java'
id "com.ewerk.gradle.plugins.querydsl" version "1.0.10"
}
group = 'com.example'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '1.8'
repositories {
mavenCentral()
}
dependencies {
compileOnly 'org.projectlombok:lombok:1.18.12'
annotationProcessor 'org.projectlombok:lombok:1.18.12'
testCompileOnly 'org.projectlombok:lombok:1.18.12'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.12'
compile group: 'org.hibernate', name: 'hibernate-validator', version: '6.1.5.Final'
// QueryDSL
compile "com.querydsl:querydsl-sql:${queryDslVersion}"
compile("com.querydsl:querydsl-core:${queryDslVersion}")
compileOnly "com.querydsl:querydsl-jpa:${queryDslVersion}"
/* TEST */
// Querydsl
testCompile "com.querydsl:querydsl-sql:${queryDslVersion}"
testAnnotationProcessor("com.querydsl:querydsl-apt:${queryDslVersion}:general")
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.liquibase:liquibase-core'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
runtimeOnly 'org.postgresql:postgresql'
testImplementation('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
}
apply plugin: 'liquibase'
apply plugin: "com.ewerk.gradle.plugins.querydsl"
test {
useJUnitPlatform()
}
【问题讨论】:
-
签出github.com/ewerk/gradle-plugins/issues/108 添加到你的build.gradle:compileQuerydsl { options.annotationProcessorPath = configurations.querydsl }
标签: spring spring-boot querydsl