方式一:打war包到tomcat/webapps目录
点击在项目上面 -> 右键 -> Run As -> Maven install
之后查看Maven输出路径:
D:apache-maven-3.3.9
epositiorycomcgtMacPwdGenService .0.1-SNAPSHOTMacPwdGenService-0.0.1-SNAPSHOT.war
[INFO] --- maven-install-plugin:2.4:install (default-install) @ MacPwdGenService --- [INFO] Installing C:UsersTuoDesktopMacPwdGenService2 argetMacPwdGenService.war to D:apache-maven-3.3.9 epositiorycomcgtMacPwdGenService0.0.1-SNAPSHOTMacPwdGenService-0.0.1-SNAPSHOT.war [INFO] Installing C:UsersTuoDesktopMacPwdGenService2pom.xml to D:apache-maven-3.3.9 epositiorycomcgtMacPwdGenService0.0.1-SNAPSHOTMacPwdGenService-0.0.1-SNAPSHOT.pom [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 4.821 s [INFO] Finished at: 2017-03-02T13:29:05+08:00 [INFO] Final Memory: 11M/156M [INFO] ------------------------------------------------------------------------
在指定目录下找到生成的war包,复制到tomcat/webapps目录;
启动Tomcat服务后即完成部署。
方法二: 添加到Server(Tomcat)
切换到 Server Tab页,选中 Tomcat 右键 -> Add and remove
随后启动 Tomcat 即可。