创建Maven Web项目
这里需要填写GroupId和ArtifactId还有Version,这三个属性目的是标识你的项目的唯一性。这些只在发布时有用,在此可以随便填写,填好后点Next,到如下界面。
选择maven的版本
项目名和路径,填完之后finish就好了
maven会在后台生成web项目,这需要等待一定的时间,视网络环境而定,经验发现用较新版本的maven项目生成更快,使用IDEA集成的maven可能会等待很长一段时间。
修改pom.xml文件
将···改为下面:
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.version>4.2.4.RELEASE</spring.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<hibernate.version>4.3.0.Final</hibernate.version>
<junit.version>4.11</junit.version>
<hamcrest.version>1.3</hamcrest.version>
<mockito.core.version>1.9.5</mockito.core.version>
</properties>
<dependencies>
<!-- Spring & Spring mvc -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-expression</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId></