plugins plugin artifactIdmaven-compiler-plugin/artifactId configuration source1.8/source target1.8/target /configuration /plugin plugin artifactIdmaven-resources-plugin/artifactId executions execution idcopy-web/id phasepackage/phase goals
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>copy-web</id>
<phase>package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>target/META-INF/resources</outputDirectory>
<resources>
<resource>
<directory>src/main/webapp</directory>
<includes>
<include>**</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-lib</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>target/lib</outputDirectory>
<excludeTransitive>false</excludeTransitive>
<stripVersion>false</stripVersion>
<includeScope>runtime</includeScope>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.1.1</version>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
<mainClass>com.demo.MainApplication</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>16</source>
<target>16</target>
</configuration>
</plugin>
</plugins>
<!--
SpringBoot项目默认推荐使用的前端引擎是thymeleaf
现在我们要使用SpringBoot集成jsp,手动指定jsp最后编译的路径
同时SpringBoot集成jsp编译jsp的路径是规定好的:META-INF/resources
-->
<resources>
<resource>
<!-- 源文件夹 -->
<directory>src/main/webapp</directory>
<!-- 指定编译到的路径为 META-INF/resources -->
<targetPath>META-INF/resources</targetPath>
<!-- 指定源文件夹中的哪些资源需要进行编译 -->
<includes>
<include>**</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**</include>
</includes>
</resource>
</resources>