环境配置: tomcat+jdk1.8+maven+springboot+intellij idea
创建项目需要的准备工作:
1.下载maven的jar包
项目的git地址:https://github.com/wanglinlin0310/webdemo
1.打开idea创建一个maven项目
构建成功后的目录结构如下
2.根据需要创建以下目录
3.pom.xml文件配置
工程中用到的第三方jar包需要在pom.xml中配置,maven会自动下载
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>