Spring Boot使用JSP文件的POM设置
程序员文章站
2022-03-02 15:38:43
...
在网上找到了大片文章,其实都大同小异,最关键的问题在于POM文件,如下是我成功运行的pom文件
<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.2.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.fqcs</groupId>
<artifactId>code_mng</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>code_mng</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- servlet依赖 -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>javax.servlet.jsp-api</artifactId>
<version>2.3.1</version>
</dependency>
<!-- tomcat的支持-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.*</include>
</includes>
</resource>
<resource>
<directory>src/main/webapp</directory>
<targetPath>META-INF/resources</targetPath>
<includes>
<include>**/*.*</include>
</includes>
</resource>
</resources>
</build>
</project>
下一篇: spring boot中pom文件解读
推荐阅读
-
Spring Boot设置并使用缓存的步骤
-
SpringBoot入坑笔记之spring-boot-starter-web 配置文件的使用
-
Spring Boot使用profile如何配置不同环境的配置文件
-
SpringBoot入坑笔记之spring-boot-starter-web 配置文件的使用
-
spring boot使用i18n时properties文件中文乱码问题的解决方法
-
Spring Boot 使用 logback、logstash、ELK 记录日志文件的方法
-
spring boot中关于获取配置文件注解的使用@ConfigurationProperties、@Value、@PropertySource
-
Spring Boot使用Docker分层打包的设置方法
-
关于对分布式文件系统FastDFS的原理和结合Spring Boot使用,最新版本tobato修正总结
-
spring创建项目xml文件的配置以及使用spring+c3p0连接池+jsp、servlet+elementUI+Vue简单实现学生管理系统的增删改查