spring boot 3x 原生支持 native

当你的项目 pom.xml 继承了:

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>3.x.x</version>
</parent>

在这个父 pom 内部,已经预先定义好了两个 profile:

  • native:用于构建 GraalVM native 原生镜像 mvn -Pnative native:compile
  • nativeTest:用于原生镜像测试 mvn -PnativeTest test

image

https://maven.apache.org/pom.html#Properties

<properties>
    <java.version>25</java.version>
    <maven.compiler.source>25</maven.compiler.source>
    <maven.compiler.target>25</maven.compiler.target>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>

https://docs.spring.io/spring-boot/maven-plugin/using.html

 

 

posted @ 2026-10-13 11:06  charyGao  阅读(5)  评论(0)    收藏  举报