您的位置:首页 > 运维架构 > Tomcat

maven设置tomcat启动方式

2018-01-29 10:51 127 查看
1,pom文件中添加

<!-- tomcat 启动插件 -->
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<!-- 可不设置 设置的话需要配置maven setting.xml文件-->
<configuration>
<url>http://localhost:8080/manager/text</url>
<server>tomcat</server>
<username>tomcat</username>
<password>123456</password>
</configuration>
</plugin>


2,maven build参数设置

-Dmaven.tomcat.port=80 -Dmaven.tomcat.path=/ tomcat:run

 
port为端口号 path为/

设置为localhost直接访问,以上可以不设置
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: