IntelliJ Idea 12.0 Build a maven Web SSH2 Schema Project example (ii) _idea
Source: Internet
Author: User
3. Introduction of an existing Maven-web-application project
The introduction of MAVEN projects differs from ordinary Web projects, and if you introduce a Maven-web project through "File"-> "Import project", the structure of the project directory structure can be confusing. The correct way is the following figure:
This is the right way to introduce an already existing Maven-web project, a little bit of attention.
4. Environmental configuration and implementation of debugging;
To run, compile, and debug a project, we first introduce a project, as shown in the previous two images, and then compile with MAVEN, holding down the CTRL key to select the clean and install two options, as shown in the following illustration, and then execute:
This is the result of successful execution of the run console, which represents a successful compilation.
Step two, add the Tomcat service, as shown in the following figure:
Select the Tomcat installation path:
The third step is to deploy the war package, as shown in the following figure:
Because it is debugging, so choose Framemodel:war exploded. In the program you are actually releasing is Framemodel:war this package, pay attention to distinguish. Then, debug, as shown in the following figure:
After successful debugging, the console results are as follows:
5.maven-web-application Project core Document: Structure analysis of Pom.xml documents
OK, play begins, Maven's Pom.xml file. The Pom file defines all third party dependencies and compilation behavior in your project. Here is a simple example of what to note in the code that has been pointed out that the code is as follows:
[html] View plain copy <span style= "Font-family:simsun;" ><project xmlns= "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. yangcl.org</groupid> <artifactId>FrameModel</artifactId> <packaging>war</packaging> <!--This defines the way your project is packaged, with war/ Bundle et--> <name>FrameModel</name> <version>1.0.0-SNAPSHOT</version> <!--prove this is a snapshot version--> <properties> <!--define some constants for Pom, which can be directly referenced elsewhere in the pom---> <spring.version>3.1.1.release</spring.version> <struts.version>2.3.4</struts.version> <!--by default, the Maven-surefire-plugin test target automatically executes the testing source code-->
< all Java classes with Test start, test, or testcase at the end of the!--path. --> <plugin> < groupid>org.apache.maven.plugins</groupid> <artifactid>maven-surefire-plugin</artifactid > <version>2.7.1</version> <configuration> <skipTests> true</skiptests> <!--here Select Skip Test > </configuration> </plugin> <!--maven clean Operation--> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactid >maven-clean-plugin</artifactId> <version>2.4.1</version> <configuration> <filesets> <fileset> <directory>${basedir}/src/main/webapp/web-inf/</ directory> <excludes> <!--exclude which content is not cleared--> <excluse>**/web.xml</excluse> </excludes> </fileset> </filesets> </configuration> </plugin> </plugins> </build> </project>
OK, so far, all the implementation, debugging, details and principles of maven-web-application have been introduced. Here are some of the mainstream ide:eclipse, MyEclipse and IntelliJ idea. The three editors I personally think the best use or idea, after all, is the charging software, the user experience is high. MyEclipse obviously some bloated, and for ExtJS4.0 above version, he is not supported, even after tuning and optimization, there will be memory overflow problem; You may say that you are not going to use it. That's because the project you're encountering is small. Also in support of Maven, Eclipse obviously does not have the idea to do well. Before the idle, but also deliberately explored the next two IDE plug-in mechanism, I found idea plug-in mechanism and eclipse, myeclipse difference is still very large, although ideas are based on OSGi. I personally think idea is ideal for developing web programs, especially MAVEN Web programs. O (︶^︶) o ay ... So tired, in order to change this blog I have to reload a blank virtual machine, I hope to be helpful to everyone, the following gives you two links, are doing a good MAVEN Web program, you can try.
First project: http://download.csdn.net/detail/breatheryang/5294757
Project Project II: HTTP://DOWNLOAD.CSDN.NET/DETAIL/BREATHERYANG/5549101
If you have any ideas, welcome to my message, we can exchange, common progress.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service