Quarkus Gradle multimodule build and Jandex

475 views Asked by At

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?

0

There are 0 answers