问题
I have a maven war project. How can I do do the following from within IntelliJ IDEA:
- create .war file
- deploy it to a local Tomcat
- start Tomcat in debug mode
回答1:
You need to configure maven-war-plugin
to build your war. tomcat<x>-maven-plugin
will allow you to deploy it to a tomcat instance and may in fact do the war generation too - I use JBoss at my current office so haven't got any experience with the maven tomcat integration.
see http://tomcat.apache.org/maven-plugin-2.0-SNAPSHOT/ and http://maven.apache.org/plugins/maven-war-plugin/ for some more details on both of these plugins.
回答2:
You can use the cargo plugin too. It works pretty well for me.
来源:https://stackoverflow.com/questions/10349678/deploy-maven-war-file-to-tomcat-from-intellij