当前位置: 首页 > 知识库问答 >
问题:

使用Maven的Quarkus项目Graal Native

巫马修然
2023-03-14

我正在尝试使用:创建本机可执行文件/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本机图像:GraalVM版本20.1.0(Java版本11.0.7)

共有1个答案

莫逸仙
2023-03-14

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

支持Java8和Java11版本。

1.6中应支持20.1。

你能试试20.0.0吗?

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

 类似资料:
  • 首先,我们需要了解什么是Maven。一个Maven的是用于构建基于Java的项目,该项目的一个工具有几个好处和选项使构建流程功能强大,易于理解和容易。Maven 负责下载所有必要的依赖项并将它们正确地包含在项目中。Maven 是 Apache 软件基金会的一部分。 以下是在我们的项目中配置 log4j 日志记录支持的最基本步骤: 1)创建一个Maven项目 输入Group Id 和 Artifac

  • 我正在学习RESTfulWeb服务教程http://www.concretepage.com/spring-4/spring-4-rest-web-service-json-example-tomcat.Is具有spring框架依赖项。我没有下载二进制文件并将其放入lib目录,而是在pom中包含了一个依赖项。xml类似 当我右键单击-

  • 在Netbeans 8.0中,我使用Maven开发JavaFX项目。我的java版本是1.7,升级到Java8有问题。我尝试将POM文件中的和更改为1.8 当我尝试创建新的JavaFX项目(如文件-new project-maven category-JavaFX Application)时,我仍然得到了使用JDK1.7的项目。如何强制使用JDK1.8?

  • 我是新来的,并尝试在Maven多模块项目中使用它。我的项目结构如下: 应用程序模块执行具有构建目标的quarkus maven插件。包含一个简单的rest控制器,因此也包含一个在中。RESTAPI模块由应用程序模块引用。 如果我使用打包整个项目,那么生成的runner jar将按预期工作。但是,如果我尝试使用在开发模式下启动项目,我会遇到以下异常: 错误]无法执行目标io。quarkus:quar

  • 我有3个maven项目。项目1,项目2 为此,我在项目2 pom.xml文件中添加了这个 我的pom。Project3的xml是- 在项目3中,我添加了testng。xml文件来运行测试。现在如果我运行这个测试。xml文件,那么我所有的测试用例都成功运行了。如果我尝试使用maven测试运行测试用例,那么它会失败。 我已经在下面的pom文件中包含了testng.xml文件,以便使用maven运行te

  • 我刚刚签出了这个项目https://github.com/tjeerdnet/onedriveapi 我的目标是运行它。 我的所作所为有什么问题? 我对maven和JEE很陌生,很抱歉noob的问题