Netty源码编译

发布时间 2023-10-14 13:13:54作者: 乐之者v

Netty源码编译

想了解Netty源码,最好先从 netty-example 开始,多跑几个 example,了解Netty的实际应用。
编译 netty-example 会出现很多乱七八糟的问题,根本原因是因为缺少 io.netty.util.collection 包。

解决方法

在这里插入图片描述
1.先 install Dev-Tools 模块
2.接着 install Common 模块

install Common 模块时,如果报错:

invalid newline character (expected: CRLF) [Newline]

执行命令

mvn clean install -DskipTests=true -Dcheckstyle.skip=true

或者在 Common 模块的 pom.xml 文件
maven-checkstyle-plugin 加入:

<plugin>
    <artifactId>maven-checkstyle-plugin</artifactId>
	<configuration>
	  <skip>true</skip>
    </configuration>
</plugin>

接着 install Common 模块。

最后重新运行 netty-example的 main方法 ,编译通过,成功运行 。