使用maven中的tomcat插件启动项目


1 pom.xml中配置tomcat 插件

 <plugin>
                <groupId>org.apache.tomcat.maven</groupId>
                <artifactId>tomcat7-maven-plugin</artifactId>
                <version>2.2</version>
                <configuration>
                    <hostName>localhost</hostName>    <!--   Default: localhost -->
                    <port>8080</port>    <!-- 启动端口 Default:8080 -->
                    <path>/HM-company-wx</path>    <!-- 访问应用路径  Default: /${project.artifactId}-->
                    <uriEncoding>UTF-8</uriEncoding>      <!-- uri编码 Default: ISO-8859-1 -->
                </configuration>
            </plugin>

2 配置命令 tomcat7:run-war

note:由于本项目是web项目,所以用的run-war命令,


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM