idea使用maven+Tomcat

1.创建maven项目,并使用webapp骨架,并修改pom.xml文件

<build>
    <finalName>myWebApp</finalName>
    <!-- 配置tomcat插件,web端 -->
    <plugins>
            <plugin>
                <groupId>org.apache.tomcat.maven</groupId>
                <artifactId>tomcat7-maven-plugin</artifactId>
                <configuration>
                    <path>/app</path>
                    <port>8080</port>
                </configuration>
            </plugin>
        </plugins>
  </build>

2.添加maven configuration

3. 使用debug启动项目, 请务必使用debug的方式启动

4.访问资源

猜你喜欢

转载自www.cnblogs.com/lovemeng1314/p/11516413.html