[hidecontent type="logged" desc="隐藏内容:登录后可查看"]
# yum install lsb-core autoconf automake libtool make tar \
glibc-devel libaio-devel openssl-devel apr-devel \
lksctp-tools
# apt-get install autoconf automake libtool make tar \
libaio-dev libssl-dev libapr1-dev \
lksctp-tools
brew install autoconf automake libtool openssl
git config --global core.autocrlf true
git config --global core.autocrlf input
cmake
和软件包。Fedora/CentOS 上的和在Fedora EPEL存储库中可用。ninja-build
golang
ninja-build
golang
./mvnw install -DskipTests -T1C
. 这也准备好您的本地 Maven 缓存,允许您稍后构建单独的模块。
idea64.exe
在安装目录中找到并使用它。否则,您会看到 IntelliJ IDEA 抱怨找不到io.netty:netty-tcnative:windows-x86_32
Use --release …
编译器设置--source
和--target
标志进行编译,但 IntelliJ 默认情况--release
下会使用较新的标志,这也启用了 API 版本检查。
使用该--release
标志会导致 IntelliJ 在构建 Netty 项目时产生编译错误,因此必须在Compiler Settings 对话框中将其禁用。
Netty project.xml
到<IntelliJ config directory>/codestyles
目录中。选择“Netty 项目”作为默认代码风格。
@SuppressWarnings
注释或行注释来抑制警告。noinspection
有关使用检查器的更多信息,请参阅Web 帮助页面。
Copyright $today.year The Netty Project
The Netty Project licenses this file to you under the Apache License,
version 2.0 (the "License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at:
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations
under the License.
The Netty project licenses
The Netty project licenses
<ECLIPSE_INSTALLATION_DIR>/plugins
(Eclipse 4.5) 或<ECLIPSE_INSTALLATION_DIR>/dropins
(Eclipse 4.6) 目录以解决 m2e 不评估我们的pom.xml
. (与其名称不同,它既是 Maven 插件又是 Eclipse 插件。)pom.xml
设置指示使用 Java SE 1.6,同时隐式使用 Java 7/8 (1.7/1.8) 功能(如果存在)。这可能会导致 Eclipse 中出现编译错误。有两种方法可以解决此问题:有关构建和开发 Netty 的详细信息,请访问开发人员指南。此页面仅提供非常基本的信息。
您需要以下内容来构建 Netty:
请注意,这是构建时要求。JDK 5(用于 3.x)或 6(用于 4.0+ / 4.1+)足以运行基于 Netty 的应用程序。
所有版本的开发都发生在名称与 相同的每个分支中<majorVersion>.<minorVersion>
。例如,3.9 和 4.1 的开发分别驻留在分支“3.9”和分支“4.1”中。
Netty 可以作为自动模块的集合用于模块化的 JDK9+ 应用程序中。模块名称遵循反向 DNS 样式,并且由于历史原因来自子项目名称而不是根包。它们如下所列:
io.netty.all
io.netty.buffer
io.netty.codec
io.netty.codec.dns
io.netty.codec.haproxy
io.netty.codec.http
io.netty.codec.http2
io.netty.codec.memcache
io.netty.codec.mqtt
io.netty.codec.redis
io.netty.codec.smtp
io.netty.codec.socks
io.netty.codec.stomp
io.netty.codec.xml
io.netty.common
io.netty.handler
io.netty.handler.proxy
io.netty.resolver
io.netty.resolver.dns
io.netty.transport
io.netty.transport.epoll
(native
省略 - Java 中的保留关键字)io.netty.transport.kqueue
(native
省略 - Java 中的保留关键字)io.netty.transport.unix.common
(native
省略 - Java 中的保留关键字)io.netty.transport.rxtx
io.netty.transport.sctp
io.netty.transport.udt
自动模块不提供任何声明依赖关系的方法,因此您需要在module-info
文件中单独列出每个使用的模块。
[/hidecontent]