Files
storageNode/pom.xml
T
root 6a97e403ba netty 按需声明,去掉用不到的模块
netty-all 是聚合 pom,会拖进 35 个模块:osx/aarch64/riscv64 的 epoll 与 kqueue
native、codec-http3/mqtt/redis/smtp/stomp/xml/protobuf、transport-rxtx/sctp/udt
等,而节点只用 ServerBootstrap/Bootstrap/NioEventLoopGroup/NioServerSocketChannel/
NioSocketChannel/ByteBuf/ByteToMessageCodec/LengthFieldBasedFrameDecoder。

收敛为 transport + codec(buffer/common/resolver 传递引入)。节点侧未使用
handler 模块的类,故不声明。4.1 无独立 codec-base,编解码基类在 netty-codec。

效果:lib 16MB -> 13MB,netty 模块 35 -> 5,进程 RSS 171MB -> 约 155-162MB。
15 个测试全绿,重启后与主站长连接正常重建(主站日志确认「存储节点上线」)。
hutool 未动。
2026-09-21 17:27:22 +08:00

155 lines
5.9 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?xml version="1.0" encoding="UTF-8"?>
<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>
<groupId>org.lion</groupId>
<artifactId>storageNode</artifactId>
<version>1.0</version>
<properties>
<maven.compiler.release>21</maven.compiler.release>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>io.netty</groupId>
<!--
只保留实际用到的模块。原先的 netty-all 是聚合 pom,会拖进 35 个模块
(含 osx/aarch64/riscv64 的 epoll/kqueue native、codec-http3/mqtt/redis/
smtp/stomp/xml/protobuf、transport-rxtx/sctp/udt 等),
而本节点只用 ServerBootstrap/Bootstrap/NioEventLoopGroup/
NioServerSocketChannel/NioSocketChannel/ByteBuf/ByteToMessageCodec/
LengthFieldBasedFrameDecoder。
transport 提供 Bootstrap/EventLoop/Channel,codec 提供
ByteToMessageCodec 与 LengthFieldBasedFrameDecoder。
buffer/common/resolver 由它们传递引入。这里不用 handler:
节点侧未使用 LoggingHandler 等 handler 模块的类。
-->
<artifactId>netty-transport</artifactId>
<version>4.1.138.Final</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-codec</artifactId>
<version>4.1.138.Final</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.22.2</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.48</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>2.0.19</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.5.38</version>
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>5.8.47</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
<version>1.28.0</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.14.4</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.2.5</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.13.0</version>
<configuration>
<annotationProcessorPaths>
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.48</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
<!-- <plugin>-->
<!-- <groupId>org.apache.maven.plugins</groupId>-->
<!-- <artifactId>maven-assembly-plugin</artifactId>-->
<!-- <version>3.4.2</version>-->
<!-- <executions>-->
<!-- <execution>-->
<!-- <phase>package</phase>-->
<!-- <goals>-->
<!-- <goal>single</goal>-->
<!-- </goals>-->
<!-- </execution>-->
<!-- </executions>-->
<!-- <configuration>-->
<!-- <descriptorRefs>-->
<!-- <descriptorRef>jar-with-dependencies</descriptorRef>-->
<!-- </descriptorRefs>-->
<!-- <archive>-->
<!-- <manifest>-->
<!-- <mainClass>lion.Main</mainClass>-->
<!-- </manifest>-->
<!-- </archive>-->
<!-- </configuration>-->
<!-- </plugin>-->
<plugin>
<groupId>org.graalvm.buildtools</groupId>
<artifactId>native-maven-plugin</artifactId>
<version>1.1.8</version>
<configuration>
<mainClass>lion.Main</mainClass>
<imageName>storageNode</imageName>
<buildArgs>
<arg>-H:+ReportExceptionStackTraces</arg>
<arg>--enable-url-protocols=https</arg>
<arg>-H:IncludeResources="logback.xml"</arg>
<arg>--initialize-at-build-time=ch.qos.logback.classic,ch.qos.logback.core,ch.qos.logback.classic.pattern,ch.qos.logback.core.pattern</arg>
<arg>-H:ReflectionConfigurationFiles=src/main/resources/reflect-config.json</arg>
</buildArgs>
<metadataRepository>
<enabled>true</enabled>
</metadataRepository>
</configuration>
</plugin>
</plugins>
</build>
</project>