[fix] 测试mapstruct 打包native异常问题

This commit is contained in:
wujiawei 2025-06-02 14:25:12 +08:00 committed by wujiawei
parent 06869dcd2f
commit a27506299e
4 changed files with 65 additions and 27 deletions

View File

@ -48,12 +48,12 @@
<dependency> <dependency>
<groupId>org.mapstruct</groupId> <groupId>org.mapstruct</groupId>
<artifactId>mapstruct</artifactId> <artifactId>mapstruct</artifactId>
<version>1.6.0.Beta1</version> <version>1.6.3</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.mapstruct</groupId> <groupId>org.mapstruct</groupId>
<artifactId>mapstruct-processor</artifactId> <artifactId>mapstruct-processor</artifactId>
<version>1.6.0.Beta1</version> <version>1.6.3</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>

View File

@ -9,9 +9,9 @@ mvn -Pnative -DskipTests clean package native:compile
```shell ```shell
mvn spring-boot:build-image -Pnative mvn spring-boot:build-image -Pnative
docker tag docker.io/library/wu-lazy-cloud-heartbeat-client-start:1.3.1-JDK17-SNAPSHOT registry.cn-hangzhou.aliyuncs.com/wu-lazy/wu-lazy-cloud-heartbeat-client-start:1.3.0-JDK17-NATIVE-SNAPSHOT docker tag docker.io/library/wu-lazy-cloud-heartbeat-client-start:1.3.1-JDK17-SNAPSHOT registry.cn-hangzhou.aliyuncs.com/wu-lazy/wu-lazy-cloud-heartbeat-client-start:1.3.1-JDK17-NATIVE-SNAPSHOT
docker push registry.cn-hangzhou.aliyuncs.com/wu-lazy/wu-lazy-cloud-heartbeat-client-start:1.3.0-JDK17-NATIVE-SNAPSHOT docker push registry.cn-hangzhou.aliyuncs.com/wu-lazy/wu-lazy-cloud-heartbeat-client-start:1.3.1-JDK17-NATIVE-SNAPSHOT
``` ```

View File

@ -32,29 +32,44 @@
<build> <build>
<plugins> <plugins>
<!-- <plugin>--> <plugin>
<!-- <groupId>org.graalvm.buildtools</groupId>--> <groupId>org.apache.maven.plugins</groupId>
<!-- <artifactId>native-maven-plugin</artifactId>--> <artifactId>maven-compiler-plugin</artifactId>
<!-- <version>0.9.23</version>--> <configuration>
<!-- <configuration>--> <source>17</source>
<!-- &lt;!&ndash; imageName用于设置生成的二进制文件名称 &ndash;&gt;--> <target>17</target>
<!-- <imageName>${project.artifactId}</imageName>--> <annotationProcessorPaths>
<!-- &lt;!&ndash; mainClass用于指定main方法类路径 &ndash;&gt;--> <path>
<!-- <mainClass>org.framework.lazy.cloud.network.heartbeat.client.LazyCloudHeartbeatClientStart</mainClass>--> <groupId>org.mapstruct</groupId>
<!-- <buildArgs>--> <artifactId>mapstruct-processor</artifactId>
<!-- &#45;&#45;no-fallback--> <version>1.6.3</version>
<!-- </buildArgs>--> </path>
<!-- </configuration>--> </annotationProcessorPaths>
<!-- <executions>--> </configuration>
<!-- <execution>--> </plugin>
<!-- <id>build-native</id>--> <plugin>
<!-- <goals>--> <groupId>org.graalvm.buildtools</groupId>
<!-- <goal>compile-no-fork</goal>--> <artifactId>native-maven-plugin</artifactId>
<!-- </goals>--> <version>0.10.3</version>
<!-- <phase>package</phase>--> <configuration>
<!-- </execution>--> <!-- imageName用于设置生成的二进制文件名称 -->
<!-- </executions>--> <imageName>${project.artifactId}</imageName>
<!-- </plugin>--> <!-- mainClass用于指定main方法类路径 -->
<mainClass>org.framework.lazy.cloud.network.heartbeat.client.LazyCloudHeartbeatClientStart</mainClass>
<buildArgs>
--no-fallback
</buildArgs>
</configuration>
<executions>
<execution>
<id>build-native</id>
<goals>
<goal>compile-no-fork</goal>
</goals>
<phase>package</phase>
</execution>
</executions>
</plugin>
<plugin> <plugin>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId> <artifactId>spring-boot-maven-plugin</artifactId>

View File

@ -32,6 +32,29 @@
<build> <build>
<plugins> <plugins>
<plugin>
<groupId>org.graalvm.buildtools</groupId>
<artifactId>native-maven-plugin</artifactId>
<version>0.10.3</version>
<configuration>
<!-- imageName用于设置生成的二进制文件名称 -->
<imageName>${project.artifactId}</imageName>
<!-- mainClass用于指定main方法类路径 -->
<mainClass>org.framework.lazy.cloud.network.heartbeat.server.LazyCloudHeartbeatServerStart</mainClass>
<buildArgs>
--no-fallback
</buildArgs>
</configuration>
<executions>
<execution>
<id>build-native</id>
<goals>
<goal>compile-no-fork</goal>
</goals>
<phase>package</phase>
</execution>
</executions>
</plugin>
<plugin> <plugin>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId> <artifactId>spring-boot-maven-plugin</artifactId>