码迷,mamicode.com
首页 > 编程语言 > 详细

maven构建springmvc项目

时间:2017-04-24 00:57:03      阅读:248      评论:0      收藏:0      [点我收藏+]

标签:code   web   isp   repo   ota   ram   列表   分享   data-   

1.Eclipse中 NEW ->OTHER->Maven->maven project

2.选择项目路径

技术分享

3.选择项目类型->next->输入groupid和artifactid->finished

技术分享

4.新建好项目之后pom.xml添加springmvc、Jackson、taglib、jstl依赖,保存

技术分享
 1 <dependencies>
 2         <dependency>
 3             <groupId>junit</groupId>
 4             <artifactId>junit</artifactId>
 5             <version>3.8.1</version>
 6             <scope>test</scope>
 7         </dependency>
 8         <!-- https://mvnrepository.com/artifact/org.springframework/spring-web -->
 9         <dependency>
10             <groupId>org.springframework</groupId>
11             <artifactId>spring-web</artifactId>
12         </dependency>
13         <dependency>
14             <groupId>org.springframework</groupId>
15             <artifactId>spring-webmvc</artifactId>
16             <version>4.2.7.RELEASE</version>
17         </dependency>
18         <dependency>
19             <groupId>jstl</groupId>
20             <artifactId>jstl</artifactId>
21             <version>1.2</version>
22         </dependency>
23         <dependency>
24             <groupId>taglibs</groupId>
25             <artifactId>standard</artifactId>
26             <version>1.1.2</version>
27         </dependency>
28         <dependency>
29             <groupId>com.fasterxml.jackson.core</groupId>
30             <artifactId>jackson-annotations</artifactId>
31             <version>2.5.0</version>
32         </dependency>
33         <dependency>
34             <groupId>com.fasterxml.jackson.core</groupId>
35             <artifactId>jackson-core</artifactId>
36             <version>2.5.0</version>
37         </dependency>
38         <dependency>
39             <groupId>com.fasterxml.jackson.core</groupId>
40             <artifactId>jackson-databind</artifactId>
41             <version>2.5.0</version>
42         </dependency>
43         <dependency>
44             <groupId>com.fasterxml.jackson.jr</groupId>
45             <artifactId>jackson-jr-all</artifactId>
46             <version>2.5.0</version>
47         </dependency>
48     </dependencies>
View Code

5.配置build path->source

技术分享

6.配置build path->libraries->jre system library 改成jdk1.6+版本

7.add library ->server runtime ->apache tomcat v7.0 (配置Tomcat的runtime包,避免运行项目时报缺少httpservletXXX的问题

技术分享

8.把maven项目转为dynamic web module

右击项目->properties->project facets->dynamic web module 2.5+(3.0 是jdk7+的)同时修改对应的compiler级别,选择dynamic web module,java,js

技术分享

9.设置部署文件路径列表 properties->deployment assembly

技术分享

用maven构建的springmvc项目就搭建完成了。

 

maven构建springmvc项目

标签:code   web   isp   repo   ota   ram   列表   分享   data-   

原文地址:http://www.cnblogs.com/cici20166/p/6754704.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!