简体   繁体   English

未找到注释处理器“org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor”

[英]Annotation processor 'org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor' not found

I am trying to implement hibernate metamodel in my spring boot application.我正在尝试在我的 Spring Boot 应用程序中实现休眠元模型。 I am getting我正进入(状态

Annotation processor 'org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor' not found

above error, while building applications.在构建应用程序时出现上述错误。

My Gradle configuration and detailed error given below下面给出了我的 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"
        }
    }
}

While running the application with ./gradlew build --info i am getting below error使用./gradlew build --info运行应用程序时,出现以下错误

在此处输入图像描述

Im using spring-boot 2.2.6, Is there any version compatibility available for hibernate-jpamodelgen.我使用的是 spring-boot 2.2.6,是否有适用于 hibernate-jpamodelgen 的版本兼容性。

I am trying to implement hibernate metamodel in my spring boot application.我正在尝试在我的 Spring Boot 应用程序中实现休眠元模型。 I am getting我正进入(状态

Annotation processor 'org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor' not found

above error, while building applications.在构建应用程序时出现上述错误。

My Gradle configuration and detailed error given below我的 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"
        }
    }
}

While running the application with ./gradlew build --info i am getting below error使用./gradlew build --info运行应用程序时,出现以下错误

在此处输入图片说明

Im using spring-boot 2.2.6, Is there any version compatibility available for hibernate-jpamodelgen.我使用的是 spring-boot 2.2.6,是否有适用于 hibernate-jpamodelgen 的版本兼容性。

You don't need to use any plugin to generate JPA metamodel.您不需要使用任何插件来生成 JPA 元模型。 It is enough to use the line用线就够了

annotationProcessor 'org.hibernate.orm:hibernate-jpamodelgen:<6.1.1.Final now or other version>'

in build.gradle dependencies block.在 build.gradle 依赖块中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 适当的警告:未找到注释处理器 - apt warning: no annotation processor found 未找到 Maven 注释处理处理器 - Maven annotation processing processor not found 找不到Netbeans错误注释处理器&#39;org.checkerframework.checker.nullness.NullnessChecker&#39; - Netbeans error Annotation processor 'org.checkerframework.checker.nullness.NullnessChecker' not found 在 Maven 中配置 hibernate-jpamodelgen - Configure hibernate-jpamodelgen in Maven 在 Kotlin(和 Gradle)中使用 Hibernate Validator Annotation Processor - Using Hibernate Validator Annotation Processor with Kotlin (and Gradle) 由于&#39;org.hibernate.HibernateException所需的@Transactional注释:找不到当前线程的异常&#39;异常 - @Transactional annotation required due to 'org.hibernate.HibernateException: No Session found for current thread' exception Hibernate:jpamodelgen - 生成 java 而不是 class - Hibernate: jpamodelgen - Generate java instead of class org.springframework.orm.hibernate4.annotation.AnnotationSessionFactoryBean - org.springframework.orm.hibernate4.annotation.AnnotationSessionFactoryBean 注释处理器 - Annotation Processor 找不到注释处理器“ io.vertx.serviceproxy.ServiceProxyProcessor” - Annotation processor 'io.vertx.serviceproxy.ServiceProxyProcessor' not found
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM