Netty源码. 使用 Eclipse 环境
直接 http://netty.io/wiki/setting-up-development-environment.html 的提示,先到github下载源码.
git clone https://github.com/netty/netty.git
操作系统安装好 mvn.eclipse 安装好m2e插件
由于习惯原因,本人也还是使用 Eclipse. 导入 eclipse.
由于官方 netty 是在 IntelliJ 上开发的, eclipse 的 mvn 插件有个 bug..
导入后需要修改以下两个地方:
1.
// project : netty-transport-native-epoll - pom.xml // 在 <build> 标签后添加 <pluginManagement> ,如下 <build> <pluginManagement> <plugins> .. </plugins> </pluginManagement> </build>
2.
// 找到 引用了 netty-tcnative 的工程,一共有4个. // 把 <classifier>${os.detected.classifier}</classifier> 改为 <version>1.1.30.Fork1</version> 如下 <dependency> <groupId>${project.groupId}</groupId> <artifactId>netty-tcnative</artifactId> <version>1.1.30.Fork1</version> <optional>true</optional> </dependency>
然后就可以跑 example 下的例子了