解决方案

  1 <dependencies>
  2         <!--Spring Boot进行Web开发的模块-->
  3         <dependency>
  4             <groupId>org.springframework.boot</groupId>
  5             <artifactId>spring-boot-starter-web</artifactId>
  6             <exclusions>
  7                 <!--去掉默认日志,加载别的日志 , 切换log4j2日志读取  -->
  8                 <exclusion>
  9                     <groupId>org.springframework.boot</groupId>
 10                     <artifactId>spring-boot-starter-logging</artifactId>
 11                 </exclusion>
 12             </exclusions>
 13         </dependency>
 14 
 15         <!--Spring Boot进行单元测试的模块-->
 16         <dependency>
 17             <groupId>org.springframework.boot</groupId>
 18             <artifactId>spring-boot-starter-test</artifactId>
 19             <scope>test</scope>
 20         </dependency>
 21         <!--导入配置文件处理器,配置文件进行绑定就会有提示-->
 22         <dependency>
 23             <groupId>org.springframework.boot</groupId>
 24             <artifactId>spring-boot-configuration-processor</artifactId>
 25             <optional>true</optional>
 26         </dependency>
 27         <!--添加支持jsp-->
 28         <dependency>
 29             <groupId>org.apache.tomcat.embed</groupId>
 30             <artifactId>tomcat-embed-jasper</artifactId>
 31             <scope>provided</scope>
 32         </dependency>
 33         <!--添加jstl表达式-->
 34         <dependency>
 35             <groupId>jstl</groupId>
 36             <artifactId>jstl</artifactId>
 37             <version>1.2</version>
 38         </dependency>
 39         <dependency>
 40             <groupId>taglibs</groupId>
 41             <artifactId>standard</artifactId>
 42             <version>1.1.2</version>
 43         </dependency>
 44         <!--mysql驱动-->
 45         <dependency>
 46             <groupId>mysql</groupId>
 47             <artifactId>mysql-connector-java</artifactId>
 48         </dependency>
 49         <!--mybatis与springboot-->
 50         <dependency>
 51             <groupId>org.mybatis.spring.boot</groupId>
 52             <artifactId>mybatis-spring-boot-starter</artifactId>
 53             <version>1.3.0</version>
 54         </dependency>
 55         <!-- tomcat 的支持.-->
 56         <dependency>
 57             <groupId>org.springframework.boot</groupId>
 58             <artifactId>spring-boot-starter-tomcat</artifactId>
 59             <scope>provided</scope>
 60         </dependency>
 61 
 62         <!--热部署-->
 63         <dependency>
 64             <groupId>org.springframework.boot</groupId>
 65             <artifactId>spring-boot-devtools</artifactId>
 66             <scope>runtime</scope>
 67             <optional>true</optional>
 68         </dependency>
 69 
 70         <!-- 分页 -->
 71         <dependency>
 72             <groupId>com.github.pagehelper</groupId>
 73             <artifactId>pagehelper-spring-boot-starter</artifactId>
 74             <version>1.2.12</version>
 75         </dependency>
 76         <!--校验-->
 77         <dependency>
 78             <groupId>javax.validation</groupId>
 79             <artifactId>validation-api</artifactId>
 80             <version>2.0.1.Final</version>
 81         </dependency>
 82 
 83         <!-- log4j2 -->
 84         <dependency>
 85             <groupId>org.springframework.boot</groupId>
 86             <artifactId>spring-boot-starter-log4j2</artifactId>
 87         </dependency>
 88 
 89 
 90     </dependencies>
 91 
 92     <build>
 93         <plugins>
 94             <plugin>
 95                 <groupId>org.springframework.boot</groupId>
 96                 <artifactId>spring-boot-maven-plugin</artifactId>
 97                 <version>1.4.2.RELEASE</version>
 98             </plugin>
 99             <plugin>
100                 <groupId>org.apache.maven.plugins</groupId>
101                 <artifactId>maven-resources-plugin</artifactId>
102                 <configuration>
103                     <encoding>UTF-8</encoding>
104                     <useDefaultDelimiters>true</useDefaultDelimiters>
105                 </configuration>
106             </plugin>
107         </plugins>
108         <resources>
109             <!-- 打包时将jsp文件拷贝到META-INF目录下-->
110             <resource>
111                 <!-- 指定resources插件处理哪个目录下的资源文件 -->
112                 <directory>src/main/webapp</directory>
113                 <!--注意必须要放在此目录下才能被访问到-->
114                 <targetPath>META-INF/resources</targetPath>
115                 <includes>
116                     <include>**/**</include>
117                 </includes>
118             </resource>
119             <resource>
120                 <directory>src/main/resources</directory>
121                 <includes>
122                     <include>**/**</include>
123                 </includes>
124                 <filtering>false</filtering>
125             </resource>
126             <resource>
127                 <directory>src/main/java</directory>
128                 <excludes>
129                     <exclude>**/*.java</exclude>
130                 </excludes>
131             </resource>
132         </resources>
133     </build>

按照红色的配置即可

posted on 2020-03-07 16:22  西门夜说  阅读(1662)  评论(0编辑  收藏  举报