今天接到项目需求,要求把现有的项目改为springboot框架启动的形式。
首先:springboot框架启动有两种方式:jar和war部署运行
了解我们项目的整个工程结构。
我们项目目前是用tomcat容器启动的maven项目,包含若干个子项目
而改为springboot框架启动,我在原来的基础上增加了一个子项目。
一、在新增的子项目增加一个pom.xml ,然后部署方式是jar
<parent>
<groupId>×××.×××.×××.××××.×××</groupId>
<artifactId>指向父类的项目名称</artifactId>
<version>指向父类的项目版本号</version>
<relativePath>指向父类的项目/pom.xml</relativePath>
</parent>
<packaging>jar</packaging>
<artifactId>子项目名称</artifactId>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.4.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.sp