Configure Profile
Add the following to the submodule:
<profiles>
<profile>
<id>native</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.graalvm.buildtools</groupId>
<artifactId>native-maven-plugin</artifactId>
<configuration>
<mainClass>
com.github.crazyrunsnail.careportal.module.hospital.CarePortalHospitalApplication
</mainClass>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
Configure spring-boot-maven-plugin
Add the following under spring-boot-maven-plugin:
<executions>
<execution>
<id>process-aot</id>
<goals>
<goal>process-aot</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>com.github.crazyrunsnail.careportal.module.hospital.CarePortalHospitalApplication</mainClass>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
</configuration>
Remove spring-boot-devtools Dependency
<!-- <dependency>-->
<!-- <groupId>org.springframework.boot</groupId>-->
<!-- <artifactId>spring-boot-devtools</artifactId>-->
<!-- <scope>runtime</scope>-->
<!-- <optional>true</optional>-->
<!-- </dependency>-->
Run:
mvn -Pnative clean native:compile
Configure MyBatis and MyBatis Plus
Add configuration classes: MybatisPlusRuntimeHintsRegistrar and
MyBatisNativeConfiguration.
Run again:
mvn -Pnative clean native:compile
Top comments (0)