Maven配置Spring+SpringMVC+MyBatis(3.2.2)Pom
来源:互联网 发布:高保真原型 软件 编辑:程序博客网 时间:2024/05/08 16:13
配置原则:
利用依赖,将所需的jar包载入到工程中。
先依赖主要jar包
Spring + Spring MVC + MyBatis + database再依赖次要jar包
C3p0连接池,log4j,Junit外围jar包
POI jFreeCharts jxl
例子:
通常只使用Spring时,将spring-context依赖到pom中。
<dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> <version>${org.springframework.version}</version></dependency>
效果图如下:
spring-context会将一下jar,自动依赖过来。
commons-logging:1.1.1spring-aop:3.2.2.RELEASEspring-beans:3.2.2.RELEASEspring-context:3.2.2.RELEASEspring-core:3.2.2.RELEASEspring-expression:3.2.2.RELEASE
由于,这个项目使用Spring+SpringMVC+MyBatis作为架构,其核心就SpringMVC。
所以首先依赖spring-webmvc
<dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> <version>${org.springframework.version}</version></dependency>
同理,spring-webmvc会将以下jar包自动依赖到工程中。
commons-logging:1.1.1spring-aop:3.2.2.RELEASEspring-beans:3.2.2.RELEASEspring-context:3.2.2.RELEASEspring-core:3.2.2.RELEASEspring-expression:3.2.2.RELEASEspring-web:3.2.2.RELEASEspring-webmvc:3.2.2.RELEASE
效果图如下:
使用Spring时,缺少不了事务的存在,而事务是在spring-orm中,将spring-orm依赖到项目中
<dependency> <groupId>org.springframework</groupId> <artifactId>spring-orm</artifactId> <version>${org.springframework.version}</version> </dependency>
同理,spring-orm会将一下jar包,自动依赖到工程中。
下面是Spring + SpringMVC + MyBatis + POI 的所有POM.xml文件信息。
<properties><org.springframework.version>3.2.2.RELEASE</org.springframework.version></properties><dependencies><dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> <version>${org.springframework.version}</version></dependency><dependency> <groupId>org.springframework</groupId> <artifactId>spring-orm</artifactId> <version>${org.springframework.version}</version></dependency><dependency> <groupId>org.springframework</groupId> <artifactId>spring-test</artifactId> <version>${org.springframework.version}</version> <type>jar</type> <scope>test</scope></dependency><dependency> <groupId>org.aspectj</groupId> <artifactId>aspectjweaver</artifactId> <version>1.8.2</version></dependency><dependency> <groupId>org.mybatis</groupId> <artifactId>mybatis</artifactId> <version>3.2.2</version></dependency><dependency> <groupId>org.mybatis</groupId> <artifactId>mybatis-spring</artifactId> <version>1.2.0</version></dependency><dependency> <groupId>c3p0</groupId> <artifactId>c3p0</artifactId> <version>0.9.1.2</version></dependency><dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>5.1.31</version></dependency><dependency> <!--会级联加载:log4j --> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> <version>1.6.1</version></dependency><dependency> <groupId>org.apache.poi</groupId> <artifactId>poi</artifactId> <version>3.9</version></dependency><dependency> <groupId>org.apache.poi</groupId> <artifactId>poi-ooxml</artifactId> <version>3.9</version></dependency><dependency> <groupId>jfree</groupId> <artifactId>jfreechart</artifactId> <version>1.0.13</version></dependency><dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.9</version></dependency><dependency> <groupId>commons-fileupload</groupId> <artifactId>commons-fileupload</artifactId> <version>1.2.2</version></dependency><dependency> <groupId>commons-io</groupId> <artifactId>commons-io</artifactId> <version>2.0.1</version></dependency><dependency> <groupId>javax.servlet.jsp.jstl</groupId> <artifactId>jstl-api</artifactId> <version>1.2</version></dependency><dependency> <groupId>org.glassfish.web</groupId> <artifactId>jstl-impl</artifactId> <version>1.2</version></dependency><dependency> <groupId>jexcelapi</groupId> <artifactId>jxl</artifactId> <version>2.4.2</version></dependency><dependency> <groupId>org.apache.tomcat</groupId> <artifactId>tomcat-servlet-api</artifactId> <version>7.0.8</version> <scope>provided</scope></dependency>
使用Intellij IDEA 查看POM依赖视图:
- View --> 选中 Tools Buttons
- 点击左侧的Struture视图。
- 在Project右键 --> Diagrams --> Show Dependencies
0 0
- Maven配置Spring+SpringMVC+MyBatis(3.2.2)Pom
- Maven配置Spring+SpringMVC+MyBatis(3.2.2)Pom 以及 IntelliJ IDEA 如何打开依赖视图
- Maven配置Spring+SpringMVC+MyBatis(3.2.2)Pom 以及 IntelliJ IDEA 如何打开依赖视图
- Spring+Mybatis+SpringMVC+Maven的pom.xml的配置
- java中spring+springMVC+Mybatis主流框架maven的pom.xml配置参考
- java中spring+springMVC+Mybatis主流框架maven的pom.xml配置参考
- java中spring+springMVC+Mybatis主流框架maven的pom.xml配置参考
- spring+springMVC+Mybatis主流框架maven的pom.xml配置参考
- java中spring+springMVC+Mybatis主流框架maven的pom.xml配置参考
- 整合SpringMVC+Spring+Mybatis+mysql的maven配置文件pom.xml
- maven创建spring+springmvc+mybatis项目pom文件
- Maven+Mybatis+Spring配置之第一步:配置pom.xml依赖
- Spring MVC +Mybatis + Maven 配置之pom.xml配置
- SSM Spring +SpringMVC+Mybatis 配置 及pom.xml
- maven+springmvc+spring+mybatis 配置实例
- maven springMVC + Mybatis + spring 常用配置
- maven+Spring+SpringMVC+Mybatis 整合 xml配置
- springMVC+spring+maven+mybatis第一篇配置
- 博弈论——acm
- 题目:定义一个交通灯枚举,包含红灯、绿灯、黄灯,需要有获得下一个灯的方法, * 例如:红灯获取下一个灯是绿灯,绿灯获取下一个灯是黄灯
- 重点帖子整理(更新中...)
- springmvc controller入参Object与前台ajax发送注意项
- mySql数据库--判断库、表是否存在
- Maven配置Spring+SpringMVC+MyBatis(3.2.2)Pom
- Cocos2d动作:移动、变形、闪烁
- (1) 写一个 Properties 格式的配置文件,配置类的完整名称。 * (2) 写一个程序,读取这个 Properties 配置文件,获得类的完整名称并加载这个类,用 反射 的方式运行
- 责任链模式
- pcb布线浅谈----各种布线的经验介绍
- [深入浅出Cocoa]iOS网络编程之NSStream
- 在windows Server 2008 R2服务器上使用infopath不能将表单发布到sharepoint 服务器的问题处理。
- Longest Increasing Path in a Matrix
- Rust 1.7.0 语法基础 sep_token 和 non_special_token