The virtual path mapping relationship is as follows: The
displayed Hello World! is the content in index.jsp.
12. The right side of the Maven project is composed of
13. The pom file
pom.xml is the core configuration file of Maven.
14. Using the empty project javaweb-01-maven02 just created, manually add content in pom.xml
Import the jar package through the Maven repository https://mvnrepository.com/:
15. Since Maven's agreement is greater than the configuration, we may encounter the problem that the configuration file we wrote cannot be exported or become effective in the future. The solution is https: //www.cnblogs.com/pixy/p/4798089.html
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<excludes>
<exclude> /*.properties</exclude>
<exclude>* / .xml</exclude>
</excludes>
<filtering>false</filtering>
</resource>
<resource>
<directory>src/main/java</directory>
<includes>
<include> /* .properties</include>
<include>* / .xml</include>
</includes>
<filtering>false</filtering>
</resource>
</resources>
</build>
Add the above code to the pom.xml file.
16. Possible problems:
1. If there is a jar package in the local warehouse directory before, it is best to delete it in advance and then build the project.
2. In the website project, the web.xml file in the WEB-INF directory should be replaced with the web.xml of the tomcat version you are using.