For the MAVEN-configured SPRING+MVC project, we are debugging with the Maven jetty and Tomcat plug-in, which is handy. But when it comes to debugging, the Web server that these plug-ins start, it's probably not as simple as how to start and run our project as a Web project. Figuring out how they start up is a reference to our project, that's the purpose.
If the name of the project is MVN_MVC, the entire directory structure is as shown above.
Usually we first generate the red portion of the target directory above with MVN package. Its equivalent execution mvn compile test-compile test war:exploded War:war. That includes compiling, testing, and packaging three steps. We can then use MVN jetty:run or MVN tomcat:run to launch the site and the test runs. This will generate a temporary JSP directory, jetty the corresponding directory name is WORK,TOMCAT directory name is Tomcat.
So, the corresponding directory of the project is the TARGET/MVN_MVC directory.
It's not the same.
The real project directory should be: The Java class for this project comes from the target/classes of the maven configuration of the jar package that this project relies on (and there is no actual physical directory for the MAVEN plug-in dynamic organization management) The configuration files and static resources that this project relies on are derived from the Src/main/webapp
To sum up, you can get two conclusions: runtime, in fact, and TARGET/MVN_MVC this directory (Packaging project directory) has no relationship. So if you modify the dynamic class and static files of this directory during the operation, you will not see the effect. The Src/main/java and Src/main/webapp must be changed. In addition, MAVEN design project idea is: the SRC directory is pure This project code, no temporary files and dependent jar package. This also facilitates the management of the code: you write your own, other people's machines are put elsewhere
If your program is debugging an exception, check it by this method.