Netty源码学习记录-编译问题-原理学习

 

netty源码下载

https://netty.io/downloads.html

 

netty源码编译问题

1、把不到 io.netty.util.collection 包下的类;

该包下的类是自动生成的,common/src/main/script和common/src/main/templates是生成原料。

实际操作命令

cd /Users/admin/Documents/code/java/netty-netty-4.1.79.Final/common
mvn clean package -DskipTests=true -Dcheckstyle.skip=true

执行成功后,生成collection包下的各个类。

 

2、找不到 netty-tcnative-2.0.53.Final.jar 的问题

Failure to transfer io.netty:netty-tcnative:jar:${tcnative.classifier}:2.0.53.Final 

原因出在netty-parent的pom.xml,将下面这行注释掉

<tcnative.classifier>${os.detected.classifier}</tcnative.classifier>

把它改为空内容即可

<tcnative.classifier></tcnative.classifier>

 

3、莫名奇妙 netty-transport-udt 工程报找不到 org.slf4j.Logger

在 transport-udt/pom.xml中加入

<!-- adapter log4j -->
<dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>log4j-over-slf4j</artifactId>
    <version>1.7.12</version>
</dependency>
<!-- adapter commons-logging -->
<dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>jcl-over-slf4j</artifactId>
    <version>1.7.12</version>
</dependency>
<dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-simple</artifactId>
    <version>1.7.12</version>
    <scope>compile</scope>
  </dependency>
<!-- log end -->

 

posted @ 2022-07-13 16:32  会飞的斧头  阅读(229)  评论(0编辑  收藏  举报