【问题标题】:Spring boot 3.0 RC1 native-maven-plugin passing arguments to native image build?Spring boot 3.0 RC1 native-maven-plugin 将参数传递给本机图像构建?
【发布时间】:2022-11-17 11:46:37
【问题描述】:

使用 Spring Boot 3.0 RC1 spring 团队决定移动所有的 graalvm本机 Maven 插件配置到 spring-boot-parent ......我们只是继承了本机配置文件。我喜欢这一举措,但我们已经失去了传递本机图像构建参数的可能性......buildArgs。

除了完全覆盖子 pom.xml 中的“native-maven-plugin”定义之外,是否有可能使用 Spring Boot 3.0 RC1 将本机图像构建参数传递给 native-maven-plugin?

我的意思是 buildArgs:

<configuration>
         <imageName>${binary-name}</imageName>
         <skip>${skip-native-build}</skip>
         <buildArgs>
             <buildArg>-H:+ReportExceptionStackTraces ${native-image-extra-flags}. </buildArg>
         </buildArgs>
     </configuration>

谢谢。

【问题讨论】:

    标签: java spring spring-boot graalvm-native-image spring-native


    【解决方案1】:

    对于任何感兴趣的人。有两种选择。使用所需的构建参数覆盖 graalvm 构建插件。看一下这个。

    https://graalvm.github.io/native-build-tools/latest/maven-plugin.html#configuration-reusing-config-from-parent

    或调用本机图像构建工具。

    【讨论】:

      【解决方案2】:

      你可以使用这个,但它在 springboot 3.0 RC 版本中仍然有错误

      <plugin>
          <groupId>org.springframework.boot</groupId>
          <artifactId>spring-boot-maven-plugin</artifactId>
              <configuration>
                  <jvmArguments>--enable-preview</jvmArguments>
                  <compilerArguments>--enable-preview</compilerArguments>
              </configuration>
      </plugin>
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2021-06-18
        • 1970-01-01
        • 1970-01-01
        • 2021-10-03
        • 2015-03-18
        • 2019-10-03
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多