# week15 **Repository Path**: javegui/week15 ## Basic Information - **Project Name**: week15 - **Description**: No description available - **Primary Language**: Java - **License**: AGPL-3.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-06-16 - **Last Updated**: 2021-06-17 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # week15 #### 介绍 通过 GraalVM 将一个简单 Spring Boot 工程构建为 Native Image,要求: 代码要自己手写 @Controller @RequestMapping("/helloworld") 相关插件可以参考 Spring Native Samples (可选) 理解 Hint 注解的使用 安装graalvm 见https://www.graalvm.org/docs/getting-started/macos/ #### 编译过程 1. 执行 ./mvnw package -Pnative -DskipTests 经过漫长的等待,在target 目录生成对应的native可执行文件 ![编译成功](https://images.gitee.com/uploads/images/2021/0617/010302_97e2b92a_816611.png "屏幕截图.png") #### 使用说明 运行native 可执行文件,基本上秒级启动完成 ![运行成功](https://images.gitee.com/uploads/images/2021/0617/010408_ac1ee302_816611.png "屏幕截图.png") 2、请求http://localhost:8001/helloworld,浏览器回显 hello spring boot native