一 、配置git (未安裝git, 能夠先安裝git)html
git config --global core.autocrlf true
配置以後,git將會根據使用者的系統自動將下載項目中的換行符轉換成系統的換行符,由於一個項目中的多個開發者使用的系統不一樣,對應的換行符不一樣,若是直接下載項目代碼的話,編譯netty項目會出現以下錯誤java
... D:\Knowledge\SOURCE\netty\netty-4.0\common\src\test\java\io\netty\util\ThreadDeathWatcherTest.java:0: File does not end with a newline. D:\Knowledge\SOURCE\netty\netty-4.0\common\src\test\java\io\netty\util\ThreadDeathWatcherTest.java:0: invalid newline character (expected: CRLF) D:\Knowledge\SOURCE\netty\netty-4.0\common\src\test\java\io\netty\util\UniqueNameTest.java:0: File does not end with a newline. D:\Knowledge\SOURCE\netty\netty-4.0\common\src\test\java\io\netty\util\UniqueNameTest.java:0: invalid newline character (expected: CRLF) Audit done. [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ ... [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:2.12.1:check (check-style) on project netty-common: Failed during checkstyle execution: There are 314 checkstyle errors. -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException Process finished with exit code 1
2、git clone netty項目git
netty項目網址:https://github.com/netty/nettygithub
在git bash命令行下,使用以下命令 clone 項目apache
git clone https://github.com/netty/netty.git
3、 使用idea工具打開netty項目,編譯netty (直接使用maven編譯也是能夠的)bash
輸入如下命令編譯 maven
mvn clean package -DskipTests
結果,編譯成功,可在target文件夾下找到對應的jar包ide