Skip to content

Latest commit

 

History

History
56 lines (51 loc) · 3.19 KB

README.md

File metadata and controls

56 lines (51 loc) · 3.19 KB

spring-boot-starter-netty

[English] [中文]

Introduction

This is a Spring Boot embedded servlet container project base on netty API (4.1.12.Final).
This project has been publish into maven center repository, refer to The Central Repository.

Maven Dependencies

  1. add the dependencies below to your maven project:
<dependencies>
    <!-- exludes embedded Tomcat -->
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
        <exclusions>
            <exclusion>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-tomcat</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <!-- include this netty servlet container -->
    <dependency>
        <groupId>io.gitlab.leibnizhu</groupId>
        <artifactId>spring-boot-starter-netty</artifactId>
        <version>1.0</version>
    </dependency>
</dependencies>
  1. add scanBasePackages property to @SpringBootApplication annotation in your Spring-Boot entry class, like:
@SpringBootApplication(scanBasePackages = {"io.gitlab.leibnizhu", "your.package.name"})
@EnableScheduling
public class AwpApplication extends SpringBootServletInitializer {
    public AwpApplication() {
    }

    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(new Class[]{AwpApplication.class});
    }

    public static void main(String[] args) {
        SpringApplication.run(AwpApplication.class, args);
    }
}
  1. run your Spring-Boot application and enjoy it.

Blogs about how to design/code this project

Only Chineses, updating one after another……
基于Netty的Spring Boot内置Servlet容器的实现(一)
基于Netty的Spring Boot内置Servlet容器的实现(二)
基于Netty的Spring Boot内置Servlet容器的实现(三)
基于Netty的Spring Boot内置Servlet容器的实现(四)
基于Netty的Spring Boot内置Servlet容器的实现(五)