This is an automated email from the ASF dual-hosted git repository.
zrlw pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo-samples.git
The following commit(s) were added to refs/heads/master by this push:
new 051bf8bb2 fix dubbo-samples-native-image (#1273)
051bf8bb2 is described below
commit 051bf8bb2674b3e9841d1f97aa9f2ddd632b793a
Author: zrlw <[email protected]>
AuthorDate: Wed Nov 19 06:55:46 2025 +0800
fix dubbo-samples-native-image (#1273)
* fix dubbo-samples-native-image
* modify dubbo-samples-native-image pom.xml with only defining modules
---
.../dubbo-samples-native-image-consumer/Dockerfile | 11 +-
.../dubbo-samples-native-image-consumer/README.md | 2 +-
.../dubbo-samples-native-image-consumer/pom.xml | 327 ++++++++++++++++-----
.../consumer/NativeDemoConsumerApplication.java | 5 +-
.../dubbo-samples-native-image-provider/Dockerfile | 9 +-
.../dubbo-samples-native-image-provider/README.md | 2 +-
.../dubbo-samples-native-image-provider/pom.xml | 327 ++++++++++++++++-----
2-advanced/dubbo-samples-native-image/pom.xml | 241 +--------------
8 files changed, 536 insertions(+), 388 deletions(-)
diff --git
a/2-advanced/dubbo-samples-native-image/dubbo-samples-native-image-consumer/Dockerfile
b/2-advanced/dubbo-samples-native-image/dubbo-samples-native-image-consumer/Dockerfile
index 9a11a6ca2..91a93d6b6 100644
---
a/2-advanced/dubbo-samples-native-image/dubbo-samples-native-image-consumer/Dockerfile
+++
b/2-advanced/dubbo-samples-native-image/dubbo-samples-native-image-consumer/Dockerfile
@@ -1,5 +1,5 @@
# Using Oracle GraalVM for JDK 17 Community Edition
-FROM ghcr.io/graalvm/native-image-community:17-muslib AS builder
+FROM container-registry.oracle.com/graalvm/native-image-community:17-ol8 AS
builder
# Set the working directory to /home/app
WORKDIR /build
@@ -7,16 +7,15 @@ WORKDIR /build
# Copy the source code into the image for building
COPY . /build
-ARG APP_FILE
-
# Build
RUN ./mvnw clean package --no-transfer-progress native:compile -Pnative -U
+RUN ls -l /build/target
# The deployment Image
FROM container-registry.oracle.com/os/oraclelinux:9-slim
EXPOSE 9091
-# Copy the native executable into the containers
-COPY --from=builder /build/target/${APP_FILE} app
-ENTRYPOINT ["/app"]
\ No newline at end of file
+# Copy the native executable into the containers (source file name could not
contain variables)
+COPY --from=builder /build/target/dubbo-samples-native-image-consumer app
+ENTRYPOINT ["/app"]
diff --git
a/2-advanced/dubbo-samples-native-image/dubbo-samples-native-image-consumer/README.md
b/2-advanced/dubbo-samples-native-image/dubbo-samples-native-image-consumer/README.md
index 735dab5bd..8e4039d78 100644
---
a/2-advanced/dubbo-samples-native-image/dubbo-samples-native-image-consumer/README.md
+++
b/2-advanced/dubbo-samples-native-image/dubbo-samples-native-image-consumer/README.md
@@ -8,7 +8,7 @@ To do this, we've provided a [multistage Docker build
file](./Dockerfile) for bu
1. Containerise the native executable using the following command:
```shell
- docker build -f ./Dockerfile --build-arg
APP_FILE=dubbo-samples-native-image-consumer -t consumer-native:1.0.0 .
+ docker build -f ./Dockerfile -t consumer-native:1.0.0 .
```
2. Run the application:
diff --git
a/2-advanced/dubbo-samples-native-image/dubbo-samples-native-image-consumer/pom.xml
b/2-advanced/dubbo-samples-native-image/dubbo-samples-native-image-consumer/pom.xml
index 02c962b42..b8bea9862 100644
---
a/2-advanced/dubbo-samples-native-image/dubbo-samples-native-image-consumer/pom.xml
+++
b/2-advanced/dubbo-samples-native-image/dubbo-samples-native-image-consumer/pom.xml
@@ -17,86 +17,271 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo-samples-native-image</artifactId>
- <version>1.0-SNAPSHOT</version>
- </parent>
+ <!-- it should be a single module project for building docker image -->
+ <parent>
+ <groupId>org.apache</groupId>
+ <artifactId>apache</artifactId>
+ <version>23</version>
+ <relativePath/>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
- <artifactId>dubbo-samples-native-image-consumer</artifactId>
+ <groupId>org.apache.dubbo</groupId>
+ <version>1.0-SNAPSHOT</version>
+ <artifactId>dubbo-samples-native-image-consumer</artifactId>
- <dependencies>
- <dependency>
- <groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo-spring-boot-starter</artifactId>
- </dependency>
+ <properties>
+ <maven.compiler.source>17</maven.compiler.source>
+ <maven.compiler.target>17</maven.compiler.target>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter</artifactId>
- </dependency>
+ <dubbo.version>3.3.1</dubbo.version>
+ <spring-boot.version>3.2.3</spring-boot.version>
+ <protobuf-java.version>3.19.6</protobuf-java.version>
- <dependency>
- <groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo-remoting-netty4</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo-serialization-fastjson2</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo-rpc-dubbo</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo-rpc-triple</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo-registry-zookeeper</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo-remoting-zookeeper-curator5</artifactId>
- </dependency>
- <dependency>
+ <maven-compiler-plugin.version>3.10.1</maven-compiler-plugin.version>
+ <native-maven-plugin.version>0.9.28</native-maven-plugin.version>
+ </properties>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-dependencies</artifactId>
+ <version>${spring-boot.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-bom</artifactId>
+ <version>${dubbo.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-remoting-zookeeper-curator5</artifactId>
+ <version>${dubbo.version}</version>
+ <exclusions>
+ <exclusion>
+ <artifactId>log4j</artifactId>
+ <groupId>log4j</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>slf4j-log4j12</artifactId>
+ <groupId>org.slf4j</groupId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-registry-zookeeper</artifactId>
+ <version>${dubbo.version}</version>
+ <exclusions>
+ <exclusion>
+ <artifactId>curator-x-discovery</artifactId>
+ <groupId>org.apache.curator</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>curator-recipes</artifactId>
+ <groupId>org.apache.curator</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>curator-framework</artifactId>
+ <groupId>org.apache.curator</groupId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-metadata-report-zookeeper</artifactId>
+ <version>${dubbo.version}</version>
+ <exclusions>
+ <exclusion>
+ <artifactId>dubbo-metrics-prometheus</artifactId>
<groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo-native</artifactId>
- </dependency>
- <dependency>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-serialization-jdk</artifactId>
+ <version>${dubbo.version}</version>
+ <exclusions>
+ <exclusion>
+ <artifactId>hessian-lite</artifactId>
+ <groupId>com.alibaba</groupId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-spring-boot-autoconfigure</artifactId>
+ <version>${dubbo.version}</version>
+ <exclusions>
+ <exclusion>
+ <artifactId>dubbo</artifactId>
<groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo-config-spring6</artifactId>
- </dependency>
-
- <dependency>
- <groupId>com.google.protobuf</groupId>
- <artifactId>protobuf-java</artifactId>
- </dependency>
- <dependency>
- <groupId>com.google.protobuf</groupId>
- <artifactId>protobuf-java-util</artifactId>
- </dependency>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>com.google.protobuf</groupId>
+ <artifactId>protobuf-java</artifactId>
+ <version>${protobuf-java.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.google.protobuf</groupId>
+ <artifactId>protobuf-java-util</artifactId>
+ <version>${protobuf-java.version}</version>
+ </dependency>
</dependencies>
+ </dependencyManagement>
- <build>
- <plugins>
- <plugin>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-maven-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo-maven-plugin</artifactId>
- <configuration>
-
<mainClass>org.apache.dubbo.nativeimage.consumer.NativeDemoConsumerApplication</mainClass>
- </configuration>
- </plugin>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-spring-boot-starter</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-remoting-netty4</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-serialization-fastjson2</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-rpc-dubbo</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-rpc-triple</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-registry-zookeeper</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-remoting-zookeeper-curator5</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-native</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-config-spring6</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>com.google.protobuf</groupId>
+ <artifactId>protobuf-java</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.google.protobuf</groupId>
+ <artifactId>protobuf-java-util</artifactId>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-maven-plugin</artifactId>
+ <version>${spring-boot.version}</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>repackage</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>process-aot</id>
+ <goals>
+ <goal>process-aot</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-maven-plugin</artifactId>
+ <version>${dubbo.version}</version>
+ <configuration>
+
<mainClass>org.apache.dubbo.nativeimage.consumer.NativeDemoConsumerApplication</mainClass>
+ </configuration>
+ <dependencies>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <version>1.7.36</version>
+ </dependency>
+ </dependencies>
+ <executions>
+ <execution>
+ <phase>process-sources</phase>
+ <goals>
+ <goal>dubbo-process-aot</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+ <profiles>
+ <profile>
+ <id>native</id>
+ <build>
+ <pluginManagement>
+ <plugins>
<plugin>
- <groupId>org.graalvm.buildtools</groupId>
- <artifactId>native-maven-plugin</artifactId>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>${maven-compiler-plugin.version}</version>
+ <configuration>
+ <release>17</release>
+ <fork>true</fork>
+ <verbose>true</verbose>
+ </configuration>
</plugin>
+ </plugins>
+ </pluginManagement>
+
+ <plugins>
+ <plugin>
+ <groupId>org.graalvm.buildtools</groupId>
+ <artifactId>native-maven-plugin</artifactId>
+ <version>${native-maven-plugin.version}</version>
+ <configuration>
+
<classesDirectory>${project.build.outputDirectory}</classesDirectory>
+ <metadataRepository>
+ <enabled>true</enabled>
+ </metadataRepository>
+ <requiredVersion>22.3</requiredVersion>
+ </configuration>
+ <inherited>false</inherited>
+ <executions>
+ <execution>
+ <id>add-reachability-metadata</id>
+ <goals>
+ <goal>add-reachability-metadata</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
- </build>
+ </build>
+ </profile>
+ </profiles>
</project>
diff --git
a/2-advanced/dubbo-samples-native-image/dubbo-samples-native-image-consumer/src/main/java/org/apache/dubbo/nativeimage/consumer/NativeDemoConsumerApplication.java
b/2-advanced/dubbo-samples-native-image/dubbo-samples-native-image-consumer/src/main/java/org/apache/dubbo/nativeimage/consumer/NativeDemoConsumerApplication.java
index 37c0c7489..210c4f301 100644
---
a/2-advanced/dubbo-samples-native-image/dubbo-samples-native-image-consumer/src/main/java/org/apache/dubbo/nativeimage/consumer/NativeDemoConsumerApplication.java
+++
b/2-advanced/dubbo-samples-native-image/dubbo-samples-native-image-consumer/src/main/java/org/apache/dubbo/nativeimage/consumer/NativeDemoConsumerApplication.java
@@ -31,7 +31,10 @@ import java.lang.management.RuntimeMXBean;
@EnableDubbo(scanBasePackages = {"org.apache.dubbo.nativeimage.consumer"})
public class NativeDemoConsumerApplication {
- @DubboReference(url = "tri://127.0.0.1:50052?serialization=fastjson2")
+ /**
+ * should change to the provider's ip address and port.
+ */
+ @DubboReference(url = "tri://172.17.0.2:50052?serialization=fastjson2")
private DemoService demoService;
public static void main(String[] args) throws InterruptedException {
diff --git
a/2-advanced/dubbo-samples-native-image/dubbo-samples-native-image-provider/Dockerfile
b/2-advanced/dubbo-samples-native-image/dubbo-samples-native-image-provider/Dockerfile
index 8fa6cb155..94de1da44 100644
---
a/2-advanced/dubbo-samples-native-image/dubbo-samples-native-image-provider/Dockerfile
+++
b/2-advanced/dubbo-samples-native-image/dubbo-samples-native-image-provider/Dockerfile
@@ -9,14 +9,13 @@ COPY . /build
# Build
RUN ./mvnw clean package --no-transfer-progress native:compile -Pnative -U
-
-ARG APP_FILE
+RUN ls -l /build/target
# The deployment Image
FROM container-registry.oracle.com/os/oraclelinux:9-slim
EXPOSE 50052
-# Copy the native executable into the containers
-COPY --from=builder /build/target/${APP_FILE} app
-ENTRYPOINT ["/app"]
\ No newline at end of file
+# Copy the native executable into the containers (source file name could not
contain variables)
+COPY --from=builder /build/target/dubbo-samples-native-image-provider app
+ENTRYPOINT ["/app"]
diff --git
a/2-advanced/dubbo-samples-native-image/dubbo-samples-native-image-provider/README.md
b/2-advanced/dubbo-samples-native-image/dubbo-samples-native-image-provider/README.md
index 1f8ee605a..b9dd39cd5 100644
---
a/2-advanced/dubbo-samples-native-image/dubbo-samples-native-image-provider/README.md
+++
b/2-advanced/dubbo-samples-native-image/dubbo-samples-native-image-provider/README.md
@@ -8,7 +8,7 @@ To do this, we've provided a [multistage Docker build
file](./Dockerfile) for bu
1. Containerise the native executable using the following command:
```shell
- docker build -f ./Dockerfile --build-arg
APP_FILE=dubbo-samples-native-image-provider -t provider-native:1.0.0 .
+ docker build -f ./Dockerfile -t provider-native:1.0.0 .
```
2. Run the application:
diff --git
a/2-advanced/dubbo-samples-native-image/dubbo-samples-native-image-provider/pom.xml
b/2-advanced/dubbo-samples-native-image/dubbo-samples-native-image-provider/pom.xml
index 2d3385d50..5ec19a461 100644
---
a/2-advanced/dubbo-samples-native-image/dubbo-samples-native-image-provider/pom.xml
+++
b/2-advanced/dubbo-samples-native-image/dubbo-samples-native-image-provider/pom.xml
@@ -17,86 +17,271 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo-samples-native-image</artifactId>
- <version>1.0-SNAPSHOT</version>
- </parent>
+ <!-- it should be a single module project for building docker image -->
+ <parent>
+ <groupId>org.apache</groupId>
+ <artifactId>apache</artifactId>
+ <version>23</version>
+ <relativePath/>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
- <artifactId>dubbo-samples-native-image-provider</artifactId>
+ <groupId>org.apache.dubbo</groupId>
+ <version>1.0-SNAPSHOT</version>
+ <artifactId>dubbo-samples-native-image-provider</artifactId>
- <dependencies>
- <dependency>
- <groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo-spring-boot-starter</artifactId>
- </dependency>
+ <properties>
+ <maven.compiler.source>17</maven.compiler.source>
+ <maven.compiler.target>17</maven.compiler.target>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter</artifactId>
- </dependency>
+ <dubbo.version>3.3.1</dubbo.version>
+ <spring-boot.version>3.2.3</spring-boot.version>
+ <protobuf-java.version>3.19.6</protobuf-java.version>
- <dependency>
- <groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo-remoting-netty4</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo-serialization-fastjson2</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo-rpc-dubbo</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo-rpc-triple</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo-registry-zookeeper</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo-remoting-zookeeper-curator5</artifactId>
- </dependency>
- <dependency>
+ <maven-compiler-plugin.version>3.10.1</maven-compiler-plugin.version>
+ <native-maven-plugin.version>0.9.28</native-maven-plugin.version>
+ </properties>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-dependencies</artifactId>
+ <version>${spring-boot.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-bom</artifactId>
+ <version>${dubbo.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-remoting-zookeeper-curator5</artifactId>
+ <version>${dubbo.version}</version>
+ <exclusions>
+ <exclusion>
+ <artifactId>log4j</artifactId>
+ <groupId>log4j</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>slf4j-log4j12</artifactId>
+ <groupId>org.slf4j</groupId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-registry-zookeeper</artifactId>
+ <version>${dubbo.version}</version>
+ <exclusions>
+ <exclusion>
+ <artifactId>curator-x-discovery</artifactId>
+ <groupId>org.apache.curator</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>curator-recipes</artifactId>
+ <groupId>org.apache.curator</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>curator-framework</artifactId>
+ <groupId>org.apache.curator</groupId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-metadata-report-zookeeper</artifactId>
+ <version>${dubbo.version}</version>
+ <exclusions>
+ <exclusion>
+ <artifactId>dubbo-metrics-prometheus</artifactId>
<groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo-native</artifactId>
- </dependency>
- <dependency>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-serialization-jdk</artifactId>
+ <version>${dubbo.version}</version>
+ <exclusions>
+ <exclusion>
+ <artifactId>hessian-lite</artifactId>
+ <groupId>com.alibaba</groupId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-spring-boot-autoconfigure</artifactId>
+ <version>${dubbo.version}</version>
+ <exclusions>
+ <exclusion>
+ <artifactId>dubbo</artifactId>
<groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo-config-spring6</artifactId>
- </dependency>
-
- <dependency>
- <groupId>com.google.protobuf</groupId>
- <artifactId>protobuf-java</artifactId>
- </dependency>
- <dependency>
- <groupId>com.google.protobuf</groupId>
- <artifactId>protobuf-java-util</artifactId>
- </dependency>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>com.google.protobuf</groupId>
+ <artifactId>protobuf-java</artifactId>
+ <version>${protobuf-java.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.google.protobuf</groupId>
+ <artifactId>protobuf-java-util</artifactId>
+ <version>${protobuf-java.version}</version>
+ </dependency>
</dependencies>
+ </dependencyManagement>
- <build>
- <plugins>
- <plugin>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-maven-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo-maven-plugin</artifactId>
- <configuration>
-
<mainClass>org.apache.dubbo.nativeimage.provider.NativeDemoProviderApplication</mainClass>
- </configuration>
- </plugin>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-spring-boot-starter</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-remoting-netty4</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-serialization-fastjson2</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-rpc-dubbo</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-rpc-triple</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-registry-zookeeper</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-remoting-zookeeper-curator5</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-native</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-config-spring6</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>com.google.protobuf</groupId>
+ <artifactId>protobuf-java</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.google.protobuf</groupId>
+ <artifactId>protobuf-java-util</artifactId>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-maven-plugin</artifactId>
+ <version>${spring-boot.version}</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>repackage</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>process-aot</id>
+ <goals>
+ <goal>process-aot</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-maven-plugin</artifactId>
+ <version>${dubbo.version}</version>
+ <configuration>
+
<mainClass>org.apache.dubbo.nativeimage.provider.NativeDemoProviderApplication</mainClass>
+ </configuration>
+ <dependencies>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <version>1.7.36</version>
+ </dependency>
+ </dependencies>
+ <executions>
+ <execution>
+ <phase>process-sources</phase>
+ <goals>
+ <goal>dubbo-process-aot</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+ <profiles>
+ <profile>
+ <id>native</id>
+ <build>
+ <pluginManagement>
+ <plugins>
<plugin>
- <groupId>org.graalvm.buildtools</groupId>
- <artifactId>native-maven-plugin</artifactId>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>${maven-compiler-plugin.version}</version>
+ <configuration>
+ <release>17</release>
+ <fork>true</fork>
+ <verbose>true</verbose>
+ </configuration>
</plugin>
+ </plugins>
+ </pluginManagement>
+
+ <plugins>
+ <plugin>
+ <groupId>org.graalvm.buildtools</groupId>
+ <artifactId>native-maven-plugin</artifactId>
+ <version>${native-maven-plugin.version}</version>
+ <configuration>
+
<classesDirectory>${project.build.outputDirectory}</classesDirectory>
+ <metadataRepository>
+ <enabled>true</enabled>
+ </metadataRepository>
+ <requiredVersion>22.3</requiredVersion>
+ </configuration>
+ <inherited>false</inherited>
+ <executions>
+ <execution>
+ <id>add-reachability-metadata</id>
+ <goals>
+ <goal>add-reachability-metadata</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
- </build>
+ </build>
+ </profile>
+ </profiles>
</project>
diff --git a/2-advanced/dubbo-samples-native-image/pom.xml
b/2-advanced/dubbo-samples-native-image/pom.xml
index 2e84455f2..7ec280c8f 100644
--- a/2-advanced/dubbo-samples-native-image/pom.xml
+++ b/2-advanced/dubbo-samples-native-image/pom.xml
@@ -17,238 +17,15 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
+ <modelVersion>4.0.0</modelVersion>
- <groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo-samples-native-image</artifactId>
- <version>1.0-SNAPSHOT</version>
- <packaging>pom</packaging>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-samples-native-image</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <packaging>pom</packaging>
- <properties>
- <maven.compiler.source>17</maven.compiler.source>
- <maven.compiler.target>17</maven.compiler.target>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-
- <dubbo.version>3.3.1</dubbo.version>
- <spring-boot.version>3.2.3</spring-boot.version>
- <protobuf-java.version>3.19.6</protobuf-java.version>
-
- <maven-compiler-plugin.version>3.10.1</maven-compiler-plugin.version>
- <native-maven-plugin.version>0.9.28</native-maven-plugin.version>
- </properties>
-
- <modules>
- <module>dubbo-samples-native-image-provider</module>
- <module>dubbo-samples-native-image-consumer</module>
- </modules>
-
- <dependencyManagement>
- <dependencies>
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-dependencies</artifactId>
- <version>${spring-boot.version}</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo-bom</artifactId>
- <version>${dubbo.version}</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo-remoting-zookeeper-curator5</artifactId>
- <version>${dubbo.version}</version>
- <exclusions>
- <exclusion>
- <artifactId>log4j</artifactId>
- <groupId>log4j</groupId>
- </exclusion>
- <exclusion>
- <artifactId>slf4j-log4j12</artifactId>
- <groupId>org.slf4j</groupId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo-registry-zookeeper</artifactId>
- <version>${dubbo.version}</version>
- <exclusions>
- <exclusion>
- <artifactId>curator-x-discovery</artifactId>
- <groupId>org.apache.curator</groupId>
- </exclusion>
- <exclusion>
- <artifactId>curator-recipes</artifactId>
- <groupId>org.apache.curator</groupId>
- </exclusion>
- <exclusion>
- <artifactId>curator-framework</artifactId>
- <groupId>org.apache.curator</groupId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo-metadata-report-zookeeper</artifactId>
- <version>${dubbo.version}</version>
- <exclusions>
- <exclusion>
- <artifactId>dubbo-metrics-prometheus</artifactId>
- <groupId>org.apache.dubbo</groupId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo-serialization-jdk</artifactId>
- <version>${dubbo.version}</version>
- <exclusions>
- <exclusion>
- <artifactId>hessian-lite</artifactId>
- <groupId>com.alibaba</groupId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo-spring-boot-autoconfigure</artifactId>
- <version>${dubbo.version}</version>
- <exclusions>
- <exclusion>
- <artifactId>dubbo</artifactId>
- <groupId>org.apache.dubbo</groupId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>com.google.protobuf</groupId>
- <artifactId>protobuf-java</artifactId>
- <version>${protobuf-java.version}</version>
- </dependency>
- <dependency>
- <groupId>com.google.protobuf</groupId>
- <artifactId>protobuf-java-util</artifactId>
- <version>${protobuf-java.version}</version>
- </dependency>
- </dependencies>
- </dependencyManagement>
-
- <build>
- <pluginManagement>
- <plugins>
- <plugin>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>${maven-compiler-plugin.version}</version>
- </plugin>
- <plugin>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-maven-plugin</artifactId>
- <version>${spring-boot.version}</version>
- <executions>
- <execution>
- <goals>
- <goal>repackage</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo-maven-plugin</artifactId>
- <version>${dubbo.version}</version>
- </plugin>
- <plugin>
- <groupId>org.graalvm.buildtools</groupId>
- <artifactId>native-maven-plugin</artifactId>
- <version>${native-maven-plugin.version}</version>
- </plugin>
- </plugins>
- </pluginManagement>
- </build>
-
- <profiles>
- <profile>
- <id>native</id>
- <build>
- <pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <release>17</release>
- <fork>true</fork>
- <verbose>true</verbose>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>process-aot</id>
- <goals>
- <goal>process-aot</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo-maven-plugin</artifactId>
- <dependencies>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-simple</artifactId>
- <version>1.7.36</version>
- </dependency>
- </dependencies>
- <executions>
- <execution>
- <phase>process-sources</phase>
- <goals>
- <goal>dubbo-process-aot</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.graalvm.buildtools</groupId>
- <artifactId>native-maven-plugin</artifactId>
- <configuration>
-
<classesDirectory>${project.build.outputDirectory}</classesDirectory>
- <metadataRepository>
- <enabled>true</enabled>
- </metadataRepository>
- <requiredVersion>22.3</requiredVersion>
- </configuration>
- <executions>
- <execution>
- <id>add-reachability-metadata</id>
- <goals>
- <goal>add-reachability-metadata</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.graalvm.buildtools</groupId>
- <artifactId>native-maven-plugin</artifactId>
- <configuration>
- <skip>true</skip>
- </configuration>
- <inherited>false</inherited>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
+ <modules>
+ <module>dubbo-samples-native-image-provider</module>
+ <module>dubbo-samples-native-image-consumer</module>
+ </modules>
</project>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]