1.pom.xml
通常的springboot 的pom文件有springboot-starter-web依赖,这样会为项目添加tomcat容器,端口8080,由于这个项目用netty,不需要tomcat,所以用
spring-boot-starter和spring-boot-configuration-processor
1 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 2 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 3 <modelVersion>4.0.0</modelVersion> 4 <groupId>demo.netty</groupId> 5 <artifactId>nettyspringboot</artifactId> 6 <version>0.0.1-SNAPSHOT</version> 7 8 <parent> 9 <groupId>org.springframework.boot</groupId> 10 <artifactId>spring-boot-starter-parent</artifactId> 11 <version>2.1.6.RELEASE</version> 12