I. Preface
After reading ROCKETMQ source code, its namesrv and broker communication mechanism use is Netty, so netty generated interest. According to their own general study of the law, are the source code to download, compile, and then the breakpoint has been hit the log debugging.
So this article describes how to download the compiled Netty source code under Mac.
Two. Download the source code
GitHub Source code Address
Https://github.com/netty/netty
Open the command line through the address clone inside: git clone [email protected]:netty/netty.git
Three. command-line compilation
MVN install-dskiptests
-dskiptests represents skipping the test case step because running the test case is a bit long and you can also mvn the install directly.
After execution, the results are as follows:
Four. Import IntelliJ
Open ij, then File->open, find the Netty directory you just downloaded (the first import is a bit slow)
view-> Tool windows->maven Projects Open right Maven Projects window
Compiling, such as compiling common
Netty/common->lifecycle->install
Install execution Complete Result
Netty. Source code Compilation