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

Maven错误构建Quarkus本机映像(java.nio.file.AccessDeniedException: /./target)

伊飞光
2023-03-14

我正在尝试使用Github自托管运行程序为我的qukus应用程序构建原生映像。

这对我来说在Github托管的跑步者上非常有用,但我想在自托管的跑步者上这样做,这样我们就不会浪费Github的预算。

当我更新我的工作流程以使用自我托管的跑步者时,我开始遇到这个奇怪的异常。

runners@ip-10-0-2-105:/opt/actions-runner/_work/prime-platform/prime-platform$ mvn clean package -DskipTests -Pnative
[INFO] Scanning for projects...
[INFO]
[INFO] ----------------< com.pubfactory.prime:prime-platform >-----------------
[INFO] Building Prime Platform dev-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ prime-platform ---
[INFO] Deleting /opt/actions-runner/_work/prime-platform/prime-platform/target
[INFO]
[INFO] --- git-commit-id-maven-plugin:5.0.0:revision (get-the-git-infos) @ prime-platform ---
[INFO]
[INFO] --- maven-resources-plugin:3.2.0:resources (default-resources) @ prime-platform ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] Copying 2 resources
[INFO]
[INFO] --- quarkus-maven-plugin:2.7.5.Final:generate-code (default) @ prime-platform ---
[INFO]
[INFO] --- maven-compiler-plugin:3.10.1:compile (default-compile) @ prime-platform ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 46 source files to /opt/actions-runner/_work/prime-platform/prime-platform/target/classes
[INFO]
[INFO] --- quarkus-maven-plugin:2.7.5.Final:generate-code-tests (default) @ prime-platform ---
[INFO]
[INFO] --- maven-resources-plugin:3.2.0:testResources (default-testResources) @ prime-platform ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.10.1:testCompile (default-testCompile) @ prime-platform ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 21 source files to /opt/actions-runner/_work/prime-platform/prime-platform/target/test-classes
[INFO]
[INFO] --- maven-surefire-plugin:3.0.0-M5:test (default-test) @ prime-platform ---
[INFO] Tests are skipped.
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ prime-platform ---
[INFO] Building jar: /opt/actions-runner/_work/prime-platform/prime-platform/target/prime-platform-dev-SNAPSHOT-69f1447.jar
[INFO]
[INFO] --- quarkus-maven-plugin:2.7.5.Final:build (default) @ prime-platform ---
[INFO] [org.hibernate.Version] HHH000412: Hibernate ORM core version 5.6.5.Final
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  18.472 s
[INFO] Finished at: 2022-03-24T20:21:26Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal io.quarkus.platform:quarkus-maven-plugin:2.7.5.Final:build (default) on project prime-platform: Failed to build quarkus application: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
[ERROR]         [error]: Build step io.quarkus.smallrye.openapi.deployment.SmallRyeOpenApiProcessor#build threw an exception: java.lang.IllegalStateException: java.nio.file.AccessDeniedException: /./target
[ERROR]         at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:891)
[ERROR]         at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
[ERROR]         at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
[ERROR]         at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449)
[ERROR]         at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478)
[ERROR]         at java.base/java.lang.Thread.run(Thread.java:829)
[ERROR]         at org.jboss.threads.JBossThread.run(JBossThread.java:501)
[ERROR] Caused by: java.nio.file.AccessDeniedException: /./target
[ERROR]         at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:90)
[ERROR]         at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
[ERROR]         at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116)
[ERROR]         at java.base/sun.nio.fs.UnixFileSystemProvider.createDirectory(UnixFileSystemProvider.java:389)
[ERROR]         at java.base/java.nio.file.Files.createDirectory(Files.java:690)
[ERROR]         at java.base/java.nio.file.Files.createAndCheckIsDirectory(Files.java:797)
[ERROR]         at java.base/java.nio.file.Files.createDirectories(Files.java:783)
[ERROR]         at io.quarkus.smallrye.openapi.deployment.SmallRyeOpenApiProcessor.storeGeneratedSchema(SmallRyeOpenApiProcessor.java:694)
[ERROR]         at io.quarkus.smallrye.openapi.deployment.SmallRyeOpenApiProcessor.storeDocument(SmallRyeOpenApiProcessor.java:945)
[ERROR]         at io.quarkus.smallrye.openapi.deployment.SmallRyeOpenApiProcessor.build(SmallRyeOpenApiProcessor.java:653)
[ERROR]         at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR]         at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[ERROR]         at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR]         at java.base/java.lang.reflect.Method.invoke(Method.java:566)
[ERROR]         at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:882)
[ERROR]         ... 6 more
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
runners@ip-10-0-2-105:/opt/actions-runner/_work/prime-platform/prime-platform$

我使用的是GraalVM 22.0.0.2、Java 11.0.14、Maven 3.8.4和Quarkus 2.7.5

我尝试回滚到Quarkus 2.7.4,这个问题消失了

共有1个答案

沈俊明
2023-03-14

这似乎是Quarkus 2.7.5中的一个错误。只有决赛。修正方案是降级到2.7.4并开放https://github.com/quarkusio/quarkus/issues/24547

 类似资料:
  • 有可能在Java 16下构建本机Quarkus映像吗?没有找到任何操作说明。 不知何故,这应该是可能的,因为Oracle发布了对Java16的GraalVM支持(https://www.graalvm.org/release-notes/21_1/)

  • 我有以下简化设置: 4)应用程序.属性 当我使用本机maven配置文件(mvn clean package-pnative)运行该文件时,我得到: 使用--report-unsupport-elements-at-runtime运行它也没有太大帮助。当我删除MyEntity类时,它在Mac+GRAALVM-CE-Java11-20.0.0上成功地编译为本机可执行文件

  • 在本机映像中构建quarkus optaplanner应用程序时,我遇到此“Random/SplittableRandom”错误: 我搜索,有这篇文章与randoms原生图像,但我仍然不知道我需要做什么来解决这个问题。 似乎quarkus试图为drools类创建Random或SplittableRandom的实例,我使用optaplanner quarkus,我不使用drools规则引擎,我使用约

  • 我正在尝试基于ruby: 3.0构建Docker映像。在Dockerfile中,运行“RUN bundle install”时,开始安装依赖项,直到显示错误: Gem::Ext::BuildError:错误:未能生成Gem本机扩展#10 34.20 34.20当前目录:/usr/local/bundle/gems/tiny_tds-2.1.5/ext/tiny-tds#10 34.2/usr/lo

  • 我试图使用<code>原生映像maven插件

  • 我正在尝试使用GraalVM构建本机Quarkus映像,但遇到以下构建失败错误: 这是我第一次与GraalVM合作,所以我有点困惑。 以下是基本信息:Java版本17 Graavl VM版本graalvm-ce-javaV-22.1.0 我按照提供的步骤:https://stackoverflow.com/a/65837409/7584240和https://github.com/graalvm/