在学习Netty源码的过程中,有时候需要针对某个版本的源码进行修改,测试一些功能点.这个时候我们就需要下载指定版本的源码,修改一些配置,让源码可以正常编译成功.
1.下载指定版本的源码
访问 https://github.com/netty/netty/tags
选择需要的版本并下载zip
解压并导入到IDEA
2.修改
前提: 电脑上安装了JDK1.8
修改parent的pom.xml中的compiler
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>

3.执行命令
mvn clean install -Dcheckstyle.skip=true -Dmaven.test.skip=true
然后Rebuild Project


将Rebuild出来的错误直接注释即可,直到Rebuild成功.
这样就可以在源码里写自己的测试代码,也可以修改源码,实现一些测试功能.

网友评论