One, the use of Maven Pom into the form of plug-ins:
This is done simply by introducing the Tomcat/jetty plug-in into the POM. Reference: http://www.cnblogs.com/EasonJim/p/6687272.html
POM:
<Projectxmlns= "http://maven.apache.org/POM/4.0.0"Xmlns:xsi= "Http://www.w3.org/2001/XMLSchema-instance"Xsi:schemalocation= "http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"><Modelversion>4.0.0</Modelversion><GroupId>com.jsoft.test</GroupId><Artifactid>testweb</Artifactid><Packaging>war</Packaging><Version>1.0-snapshot</Version><Name>testweb Maven Webapp</Name><Url>http://maven.apache.org</Url><Dependencies><Dependency><GroupId>junit</GroupId><Artifactid>junit</Artifactid><Version>3.8.1</Version><Scope>test</Scope></Dependency></Dependencies><Build><Finalname>testweb</Finalname><Plugins><!--Config:maven Tomcat Plugin-<!--http://mvnrepository.com/artifact/org.apache.tomcat.maven/ Tomcat7-maven-plugin-<!--http://tomcat.apache.org/maven-plugin-2.0/tomcat7-maven-plugin/ Plugin-info.html-<plugin> <groupId>org.apache.tomcat.maven</groupId> <artifactId> Tomcat7-maven-plugin</artifactid> <version>2.2</version> <!--Config:contextpath and Port ( default:8080)-<!--<configuration> <path>/</path> <port>8899</port> </ Configuration>-</plugin> <!--config:maven Jetty Plugin--<!--http://mvnrepository.com/ Artifact/org.mortbay.jetty/jetty-maven-plugin-<!--http://www.eclipse.org/jetty/documentation/current/ Jetty-maven-plugin.html-<plugin> <groupId>org.eclipse.jetty</groupId> <artifactId> Jetty-maven-plugin</artifactid> <version>9.4.3.v20170317</version> <!--Config:contextpathand Port (default:8080)-<!--<configuration> </plugins> </build></Project>
Run:
"View", "Tool Windows", "Maven Projects"
Then select the Jetty:run of the list and right-click Run Maven Build. or Tomcat:run.
These plug-ins also have a lot of usage, to go deep use can right-click Edit ... Research goes on.
Second, run through your own Tomcat plugin:
Prerequisite: First install Tomcat, reference: (Search this blog tomcat installation)
Configuration: "Run", "Edit configurations"
Configure the local tomcat, pointing to the path to the installation:
Next click on the plus sign in the upper left corner: "Tomcat Server", "Local"
There are two options, either a war package or a compiled target folder:
1. War pack:
2. Target Folder
The end is run: "Run", "Run ..." and select the TestWeb created above.
Third, through the jetty plug-in:
The principle is the same as above:
1. Configure Jetty Local
2. Add Jetty
3. Run
Reference:
Https://www.cnblogs.com/jenkinschan/p/6052948.html
IntelliJ idea configuration Tomcat/jetty run Web project