java - 未找到注释处理器“org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor”
问题描述
我正在尝试在我的 Spring Boot 应用程序中实现休眠元模型。我正进入(状态
Annotation processor 'org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor' not found
在构建应用程序时出现上述错误。
下面给出了我的 Gradle 配置和详细错误
buildscript {
ext {
springBootVersion = '2.2.6.RELEASE'
}
repositories {
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
classpath('se.transmode.gradle:gradle-docker:1.2')
classpath("gradle.plugin.at.comm_unity.gradle.plugins:jpamodelgen-plugin:1.1.4")
}
}
group = 'com.example'
version = '0.0.1-SNAPSHOT'
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
apply plugin: "jacoco"
apply from: 'docker.gradle'
apply plugin: "at.comm_unity.gradle.plugins.jpamodelgen"
sourceCompatibility = 1.8
bootJar {
launchScript()
}
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-mail'
implementation 'org.springframework.boot:spring-boot-starter-quartz'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'io.jsonwebtoken:jjwt-api:0.10.5'
implementation 'org.flywaydb:flyway-core'
compileOnly 'org.projectlombok:lombok'
implementation 'org.springframework.boot:spring-boot-devtools'
runtimeOnly 'com.h2database:h2'
runtimeOnly 'mysql:mysql-connector-java'
runtimeOnly 'io.jsonwebtoken:jjwt-impl:0.10.5'
runtimeOnly 'io.jsonwebtoken:jjwt-jackson:0.10.5'
annotationProcessor 'org.projectlombok:lombok'
annotationProcessor('org.hibernate:hibernate-jpamodelgen:5.4.14.Final')
testImplementation('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
testImplementation 'org.springframework.security:spring-security-test'
}
test.reports.junitXml.setDestination(file("${buildDir}/test-results"))
jacocoTestReport {
reports {
html.destination file("${buildDir}/jacocoHtml")
}
}
jpaModelgen {
library = "org.hibernate:hibernate-jpamodelgen"
jpaModelgenSourcesDir="src/jpaModelgen/java"
}
sourceSets {
main {
java {
srcDirs += "src/jpaModelgen/java"
}
}
}
在运行应用程序./gradlew build --info
时出现以下错误
我使用的是 spring-boot 2.2.6,是否有适用于 hibernate-jpamodelgen 的版本兼容性。
解决方案
推荐阅读
- mongodb - 检索一个嵌入式数组并作为 mongodb 中的对象集合返回
- javascript - 在 JavaScript 中获取特定的时区时间
- iis - 如果抛出异常导致应用程序池崩溃,.Net Web API 偶尔会完全不返回任何响应
- c# - asp.net 样板错误地将实体保存为已删除
- jenkins - 如何在 Jenkins 管道中通过 bat 设置环境变量
- javascript - 理解回调函数中的“this”
- prolog - NU-Prolog 和 Gödel 的逻辑和合理的 `if-then-else` 扩展
- swift - 如何组成一个组合发布者,将最后发出的值发送给它的第二个订阅者
- spring-websocket - 如何从 Spring WebSocket STOMP 中的 UNSUBSCRIBE 框架获取订阅目的地
- javascript - 如何映射包含哈希图的数组并找到匹配的键值对