Under IDEA integrated tomcat7 plug built into the tomcat web project

  1. Create a maven web project

     

  2. Modify pom.xml file

        < Build > 
            < plugins > 
                <-! Configure Tomcat plug: 
                        that is deployed locally, the tomcat embedded in a web project, so the project can run the webapp directly. 
                        Like similar projects spring boot, no need to deploy additional tomcat, you can directly run. -> 
                < plugin > 
                    < the groupId > org.apache.tomcat.maven </ the groupId > 
                    < the artifactId > tomcat7-Maven-plugin </ the artifactId > 
                    < Configuration > 
                        <-! Do not need context http: // localhost: 8080 / xxx.jsp -> 
                        < path > / <>
                        <port>8080</port>
                    </configuration>
                </plugin>
            </plugins>
        </build>

     

  3. Running the Project

    First, click on the right Maven

    Second, click on the run in the plug-in, that is: tomcat7: run, (right selectable debug mode)

    Third, pending the completion of the project run

    Fourth, access

     

Guess you like

Origin www.cnblogs.com/HuangJie-sol/p/11401295.html