IntelliJ idea 12 Creating a maven-managed Java Web project (plot)
http://blog.csdn.net/zht666/article/details/8673609
The main use of this article is to illustrate the process of creating a Maven managed Java Web Project using Intellijidea 12.
This document is PDF : http://download.csdn.net/detail/zht666/5141235
1. New project, select Maven Module, enter the project name, click Next to continue.
Note that the module here is the meaning of the project, as in MyEclipse project.
Then click Finish directly.
After the completion of the MAVEN project, double-click Pom.xml to view the contents of the Pom file, you can add the dependency of Maven yourself. But found that there is no web directory, what to do? Look at the back.
Right-click on the project name and select Add Framework support ...
In the Add Framework Support dialog box, tick Web application, select version 3.0 and tick Create Web.
Click OK, see the following interface, the project appears in the Web file, is not familiar with, and myeclipse in the project structure similar.
Open the Pom.xml file and add the necessary maven dependencies. Also called Maven coordinates, the GroupID, Artifactid, and version uniquely determine a set of jar dependent files.
The contents of the pom.xml file I added are as follows:
<?xml version= "1.0" encoding= "UTF-8"?>
<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/xsd/maven-4.0.0.xsd" >
<modelVersion>4.0.0</modelVersion>
<groupId>SpringMvcDemo</groupId>
<artifactId>SpringMvcDemo</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<dependency> <!--junit 4.7--
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<type>jar</type>
<scope>test</scope>
</dependency>
<dependency> <!--Spring 3.2--
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>3.2.1.RELEASE</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
<type>jar</type>
</dependency>
<dependency> <!--Jackson Core Pack--
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.1.3</version>
</dependency>
<dependency> <!--Jackson Data Bundle--
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.1.3</version>
</dependency>
<dependency> <!--Jackson Note Pack--
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.1.2</version>
</dependency>
</dependencies>
</project>
Then add some content to the index.jsp file.
The Tomcat server is configured below, and this example uses TOMCAT6.
For example, select Local and then click Configure to select the Tomcat installation directory in the popup dialog box.
Select Tomcat Server, and then click the green "+" sign.
Click "+" after selecting Local, has just configured the local tomcat server.
A new Tomcat service is created here, and you can enter any name.
Click Deployment, and then click "+" on the right to add the artifact deployment.
Click OK to return to the main screen, click Application Servers open the server view, click Tomcat6[local], you can see the deployment of the project. Click the Start button above the interface to launch the Tomcat server, and the server will open the browser automatically after startup.
IntelliJ idea 12 Creating a maven-managed Java Web project (plot)