【Netty】Netty源码编译

【Netty】Netty源码编译

2023年7月13日发(作者:)

【Netty】Netty源码编译环境准备Jdk:1.8.0_181Idea:2021.1.1 Community Edition(社区版)Maven:3.6.31、下载Netty源码  本例下载的是 2、使⽤Idea打开项⽬,进⾏编译导⼊Idea:File --> Open --> 选择Netty项⽬⽬录   等待索引建⽴完成,在控制台输⼊命令:mvn clean package -DskipTests=true  可能出现的错误  问题1: Could not find artifact :netty-tcnative:jar:${fier}: in central (/maven2)  分析:maven⽆法获取${fier}的问题,参考:/weixin_43962314/article/details/108933596  解决:添加Maven运⾏参数  windows系统:命令⾏运⾏增加: -fier=windows-x86_64  Linux系统:命令⾏运⾏增加: -fier=linux-x86_64  Mac系统:命令⾏运⾏增加: -fier=osx-x86_64    或者在pom⽂件中,增加属性:osx-x86_64  问题2: [ERROR] Failed to execute goal s:maven-antrun-plugin:1.8:run (build-native-lib) on project netty-transport-native-unix-common: An Ant BuildException has occured: exec returned: 1  [ERROR] around Ant part ...... @ 4:71 in /Users/h__d/Documents/git-repository//transport-native-unix-common/target/antrun/  分析:maven-antrun-plugin插件需要执⾏命令 make,检查make命令是否可⽤,参考:/weixin_33849215/article/details/90685367  解决:修复 make 命令     问题3: maven-remote-resources-plugin 插件,⽆法加载到远程资源  解决:直接在pom⽂件中,将代码注释

3、测试运⾏⽰例  1、运⾏example项⽬中的,src/main/java/io/netty/example/http/cors/,运⾏⽂件main⽅法  2、效果如下:    3、可以使⽤telnet ⼯具进⾏连接  

发布者:admin,转转请注明出处:http://www.yc00.com/xiaochengxu/1689200148a220006.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信