1

我正在尝试使用以下命令创建本机可执行文件:./mvnw package -Pnative 该命令从过去 2 小时开始运行,但仍未完成。

我已经尝试过多次,我也重新启动了系统,但到目前为止没有任何帮助。

完整的日志:

[INFO] Scanning for projects...
[INFO]
[INFO] ---------------------< org.acme:code-with-quarkus >---------------------
[INFO] Building code-with-quarkus 1.0.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ code-with-quarkus ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ code-with-quarkus ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ code-with-quarkus ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/testuser/Desktop/quarkus-rest/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ code-with-quarkus ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.22.1:test (default-test) @ code-with-quarkus ---
[INFO]
[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] Running org.acme.ExampleResourceTest
2020-06-01 06:38:37,777 INFO  [io.quarkus] (main) Quarkus 1.4.2.Final started in 4.412s. Listening on: http://0.0.0.0:8081
2020-06-01 06:38:37,852 INFO  [io.quarkus] (main) Profile test activated.
2020-06-01 06:38:37,855 INFO  [io.quarkus] (main) Installed features: [cdi, resteasy]
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 9.505 s - in org.acme.ExampleResourceTest
2020-06-01 06:38:41,842 INFO  [io.quarkus] (main) Quarkus stopped in 0.068s
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ code-with-quarkus ---
[INFO]
[INFO] --- quarkus-maven-plugin:1.4.2.Final:build (default) @ code-with-quarkus ---
[INFO] [org.jboss.threads] JBoss Threads version 3.1.1.Final
[INFO] [io.quarkus.deployment.pkg.steps.JarResultBuildStep] Building native image source jar: /home/testuser/Desktop/quarkus-rest/target/code-with-quarkus-1.0.0-SNAPSHOT-native-image-source-jar/code-with-quarkus-1.0.0-SNAPSHOT-runner.jar
[INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildStep] Building native image from /home/testuser/Desktop/quarkus-rest/target/code-with-quarkus-1.0.0-SNAPSHOT-native-image-source-jar/code-with-quarkus-1.0.0-SNAPSHOT-runner.jar
[INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildStep] Running Quarkus native-image plugin on GraalVM Version 20.1.0 (Java Version 11.0.7)
[INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildStep] /usr/lib/jvm/graalvm-ce-java11-20.1.0/bin/native-image -J-Djava.util.logging.manager=org.jboss.logmanager.LogManager -J-Dsun.nio.ch.maxUpdateArraySize=100 -J-Dvertx.logger-delegate-factory-class-name=io.quarkus.vertx.core.runtime.VertxLogDelegateFactory -J-Dvertx.disableDnsResolver=true -J-Dio.netty.leakDetection.level=DISABLED -J-Dio.netty.allocator.maxOrder=1 -J-Duser.language=en -J-Dfile.encoding=UTF-8 --initialize-at-build-time= -H:InitialCollectionPolicy=com.oracle.svm.core.genscavenge.CollectionPolicy$BySpaceAndTime -H:+JNI -jar code-with-quarkus-1.0.0-SNAPSHOT-runner.jar -H:FallbackThreshold=0 -H:+ReportExceptionStackTraces -H:-AddAllCharsets -H:-IncludeAllTimeZones -H:EnableURLProtocols=http -H:NativeLinkerOption=-no-pie --no-server -H:-UseServiceLoaderFeature -H:+StackTrace code-with-quarkus-1.0.0-SNAPSHOT-runner
-H:IncludeAllTimeZones and -H:IncludeTimeZones are now deprecated. Native-image includes all timezonesby default.
[code-with-quarkus-1.0.0-SNAPSHOT-runner:41959]    classlist:  18,228.62 ms,  0.74 GB
[code-with-quarkus-1.0.0-SNAPSHOT-runner:41959]        (cap):   3,989.95 ms,  0.74 GB
[code-with-quarkus-1.0.0-SNAPSHOT-runner:41959]        setup:  12,572.12 ms,  0.74 GB
06:41:15,775 INFO  [org.jbo.threads] JBoss Threads version 3.1.1.Final
[code-with-quarkus-1.0.0-SNAPSHOT-runner:41959]     (clinit):  10,836.94 ms,  0.75 GB
[code-with-quarkus-1.0.0-SNAPSHOT-runner:41959]   (typeflow): 198,049.68 ms,  0.75 GB
[code-with-quarkus-1.0.0-SNAPSHOT-runner:41959]    (objects): 499,552.27 ms,  0.75 GB
[code-with-quarkus-1.0.0-SNAPSHOT-runner:41959]   (features):  13,579.92 ms,  0.75 GB
[code-with-quarkus-1.0.0-SNAPSHOT-runner:41959]     analysis: 756,771.78 ms,  0.75 GB
[code-with-quarkus-1.0.0-SNAPSHOT-runner:41959]     universe:  66,599.46 ms,  0.74 GB
[code-with-quarkus-1.0.0-SNAPSHOT-runner:41959]      (parse): 221,467.49 ms,  0.65 GB
[code-with-quarkus-1.0.0-SNAPSHOT-runner:41959]     (inline): 2,025,552.89 ms,  0.67 GB

不同技术的版本:

  1. 操作系统:Ubuntu 20.04-VB-64bit
  2. GraalVM 运行时:OpenJDK 运行时
  3. 环境 GraalVM CE 20.1.0 Native-Image:GraalVM 版本 20.1.0(Java 版本 11.0.7)
4

1 回答 1

2

目前(在 1.4 和即将发布的 1.5 上),Quarkus 仅与 GraaVM 19.3.1 (LTS) 和 20.0.0 兼容,您可以在入门页面中看到:https ://quarkus.io/get-started/

支持 Java 8 和 Java 11 版本。

1.6 应该支持 20.1。

您可以尝试使用 20.0.0 吗?

除了版本之外,我发现可用于 native-image 的内存非常低,只有 0.67 GB。您没有为 native-image 命令指定任何内存限制 (Xmx),因此我假设您在低内存设备(或低内存容器内)上运行它。本机映像需要大量内存(4GB 或更多),我认为这就是它永远不会结束的原因

于 2020-06-02T08:07:56.277 回答