我正在尝试将 Quarkus 网络服务器集成到 Gradle 多构建项目中。我一直在遵循设置 Quarkus 服务的典型指南,但遇到了一个我不知道如何解决的问题。此时我正在尝试运行默认设置(使用默认代码和测试)
运行测试时,我收到一条错误消息Unable to find native image, make sure native.image.path is set
我认为这是一个配置或依赖问题,但不知道如何解决它,因为我是 Quarkus 的新手,而且它的 Gradle 支持似乎相当缺乏......
我相信我已经正确设置了 GraalVM(使用本机映像可执行文件)。
项目,以防你想挖掘。让我知道还有什么,如果有什么可以包括在这里的话。
子项目的build.gradle:
plugins {
id 'java'
id 'io.quarkus' version '0.26.0'
}
//apply plugin: 'io.quarkus'
version = '0.0.0.63'
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
dependencies {
compile project(":BaseCode")
implementation enforcedPlatform('io.quarkus:quarkus-bom:0.26.0')
implementation 'io.quarkus:quarkus-resteasy'
implementation 'io.quarkus:quarkus-resteasy-jackson'
//implementation 'io.quarkus:quarkus-jackson'
//implementation 'io.quarkus:quarkus-elytron-security'
testImplementation 'io.quarkus:quarkus-junit5'
testCompile group: 'io.rest-assured', name: 'rest-assured', version: '3.3.0'
}
test {
useJUnitPlatform()
}
compileJava {
println "WebServer version at compile time: " + version
dependsOn ':BaseCode:test'
dependsOn 'incrementBuildVersion';
}
失败消息:
Starting process 'Gradle Test Executor 29'. Working directory: /home/greg/GitRepos/task-timekeeper/WebServer Command: /usr/lib/jvm/java-11-oracle/bin/java -Dorg.gradle.native=false @/tmp/gradle-worker-classpath17037522129690074442txt -Xmx512m -Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.variant -ea worker.org.gradle.process.internal.worker.GradleWorkerMain 'Gradle Test Executor 29'
Successfully started process 'Gradle Test Executor 29'
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.vmplugin.v7.Java7$1 (file:/home/greg/.gradle/caches/modules-2/files-2.1/org.codehaus.groovy/groovy/2.5.6/6936e700f0fb1b50bac0698ada4347a769d40199/groovy-2.5.6.jar) to constructor java.lang.invoke.MethodHandles$Lookup(java.lang.Class,int)
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.vmplugin.v7.Java7$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Gradle Test Executor 29 STANDARD_OUT
2019-10-21 23:27:02,366 DEBUG [Test worker] (org.jboss.logging.LoggerProviders.logProvider(LoggerProviders.java:158) ) - Logging Provider: org.jboss.logging.Log4j2LoggerProvider
org.acme.rest.json.LegumeResourceIT > testList() FAILED
org.junit.jupiter.api.extension.TestInstantiationException: TestInstanceFactory [io.quarkus.test.junit.QuarkusTestExtension] failed to instantiate test class [org.acme.rest.json.LegumeResourceIT]: Unable to find native image, make sure native.image.path is set
Caused by:
java.lang.RuntimeException: Unable to find native image, make sure native.image.path is set
org.acme.rest.json.FruitResourceIT > testAdd() SKIPPED
org.acme.rest.json.FruitResourceIT > testList() SKIPPED
org.acme.rest.json.LegumeResourceTest > testList() SKIPPED
org.acme.rest.json.FruitResourceTest > testAdd() SKIPPED
org.acme.rest.json.FruitResourceTest > testList() SKIPPED
6 tests completed, 1 failed, 5 skipped
Finished generating test XML results (0.0 secs) into: /home/greg/GitRepos/task-timekeeper/WebServer/build/test-results/test
Generating HTML test report...
Finished generating test html results (0.0 secs) into: /home/greg/GitRepos/task-timekeeper/WebServer/build/reports/tests/test
:WebServer:test (Thread[Execution worker for ':',5,main]) completed. Took 1.544 secs.
FAILURE: Build failed with an exception.