Quarkus Gradle多模块构建和Jandex

huangapple 未分类评论45阅读模式
英文:

Quarkus Gradle multimodule build and Jandex

问题

我正在将一个Java EE项目迁移到Quarkus,但在Quarkus构建和jandex方面遇到了问题。

我已经为Quarkus创建了一个类似于的子模块:

apply plugin: 'io.quarkus'

dependencies {
    implementation project(':core')
}

我的核心子模块看起来类似于:

apply plugin: 'org.kordamp.gradle.jandex'

dependencies {
    implementation 'io.quarkus:quarkus-hibernate-validator'
    implementation 'io.quarkus:quarkus-hibernate-orm'
}

jandex文件被创建在core/build/jandex中并添加到核心jar文件中,但构建仍然失败,显示如下错误:

> Task :quarkus:quarkusBuild FAILED
building quarkus runner

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':quarkus:quarkusBuild'.
> io.quarkus.builder.BuildException: Build failure: Build failed due to errors
        [error]: Build step io.quarkus.hibernate.orm.deployment.HibernateOrmProcessor#build threw an exception: io.quarkus.deployment.configuration.ConfigurationError: Unable to properly register the hierarchy of the following JPA classes as they are not in the Jandex index:
        - ...

我已经尝试使用以下方式复制jandex文件:

task copyJandex {
    copy {
        from "${project(':core').buildDirectory.file('jandex/jandex.idx').get()}"
        into "build/resources/main/META-INF"
    }
}
classes.dependsOn copyJandex

但这并没有解决问题。

对于可能出错的原因有什么想法吗?

英文:

I am migrating a Java EE project to Quarkus, but are having problems with the Quarkus build and jandex

I have created a submodule for Quarkus similar to:

apply plugin: 'io.quarkus'

dependencies {
    implementation project(':core')
}

and my core submodule looks similar to:

apply plugin: 'org.kordamp.gradle.jandex'

dependencies {
    implementation 'io.quarkus:quarkus-hibernate-validator'
    implementation 'io.quarkus:quarkus-hibernate-orm'
}

The jandex files is created in core/build/jandex and added to the core jar, but the build still fails with:

> Task :quarkus:quarkusBuild FAILED                                                                                                               
building quarkus runner                                                                                                                           
                                                                                                                                                  
FAILURE: Build failed with an exception.                                                                                                          

* What went wrong:
Execution failed for task ':quarkus:quarkusBuild'.
> io.quarkus.builder.BuildException: Build failure: Build failed due to errors
        [error]: Build step io.quarkus.hibernate.orm.deployment.HibernateOrmProcessor#build threw an exception: io.quarkus.deployment.configuration.ConfigurationError: Unable to properly register the hierarchy of the following JPA classes as they are not in the Jandex index:
        - ...

I have tried to copy the jandex file using:

task copyJandex {
    copy {
        from "${project(':core').buildDirectory.file("jandex/jandex.idx").get()}"
        into "build/resources/main/META-INF"
    }
}
classes.dependsOn copyJandex   

but that did not solve the issue.

Any ideas on what could be wrong?

huangapple
  • 本文由 发表于 2020年4月7日 15:18:58
  • 转载请务必保留本文链接:https://java.coder-hub.com/61074677.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定