Idea + Maven + jetty to develop Web projects, primarily demonstrating how to debug code.
1.
First we create a MAVEN project, project type select "Maven Module" and enter the project name "demo".
650) this.width=650; "src=" Http://www.linuxidc.com/upload/2012_12/121207092013781.png "vspace=" 5 "width=" 581 "/>
2.
Select the project to use the archetype as "Maven-archetype-webapp", here can also be arbitrarily modified groupid and other information.
650) this.width=650; "src=" Http://www.linuxidc.com/upload/2012_12/121207092013782.png "vspace=" 5 "width=" 581 "/>
3.
This step directly clicks "Finish".
650) this.width=650; "src=" Http://www.linuxidc.com/upload/2012_12/121207092013783.png "vspace=" 5 "width=" 581 "/>
4.
Open Maven's profile Pom.xml and add the following code to the build node, adding Maven's jetty plugin.
<plugins>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.26</version>
<configuration>
<connectors>
<connector implementation= "Org.mortbay.jetty.nio.SelectChannelConnector" >
<port>8080</port>
</connector>
</connectors>
<scanIntervalSeconds>10</scanIntervalSeconds>
</configuration>
</plugin>
</plugins>
5.
Select "Run"--"Edit configurations ..." On the toolbar, open the "Run/debug Configurations" window, click the green "+" button, and select "Maven" in the dropdown list that pops up.
650) this.width=650; "src=" Http://www.linuxidc.com/upload/2012_12/121207092066231.png "vspace=" 5 "width=" 581 "/>
6.
Take a name such as "Demo-jetty", select your working directory in the "Working Directory" column, and enter "Jetty:run" in "Command line". Then click "OK".
650) this.width=650; "src=" Http://www.linuxidc.com/upload/2012_12/121207092066232.png "vspace=" 5 "width=" 581 "/>
7.
Here, the configuration is OK, on the toolbar there is a running item called "Demo-jetty", click on the following Debug button to debug.
650) this.width=650; "src=" Http://www.linuxidc.com/upload/2012_12/121207092066233.png "vspace=" 5 "width=" 581 "/>
Reference article:
Http://www.linuxidc.com/Linux/2012-12/75554.htm
This article is from the "Nothing qq:934033381" blog, please be sure to keep this source http://tianxingzhe.blog.51cto.com/3390077/1702067
Develop Web projects using Idea Community Edition