在pom.xml中配置
<
properties
>
<!-- 统一版本信息 -->
<
spring.version
>
4.3.7.RELEASE
</
spring.version
>
</
properties
>
<
dependencies
>
<!-- spring框架基本的核心工具类 -->
<
dependency
>
<
groupId
>
org.springframework
</
groupId
>
<
artifactId
>
spring-core
</
artifactId
>
<
version
>
${spring.version}
</
version
>
</
dependency
>
<!--所有应用都要用到。包含访问配置文件、创建和管理bean以及进行Inversion of/Dependency
Injrction
(IOC/DI)操作相关的所以类。如果应用只需基本的IOC\DI支持,引入spring-core及spring-bean即可 -->
<
dependency
>
<
groupId
>
org.springframework
</
groupId
>
<
artifactId
>
spring-beans
</
artifactId
>
<
version
>
${spring.version}
</
version
>
</
dependency
>
<!-- 包含spring对
jdbc
数据访问进行封装的所有类 -->
<
dependency
>
<
groupId
>
org.springframework
</
groupId
>
<
artifactId
>
spring-
jdbc
</
artifactId
>
<
version
>
${spring.version}
</
version
>
</
dependency
>
<!-- 为JDBC、
Hibernate
、JDO、JPA提供一致性的声明式和编程式事务管理 -->
<
dependency
>
<
groupId
>
org.springframework
</
groupId
>
<
artifactId
>
spring-
tx
</
artifactId
>
<
version
>
${spring.version}
</
version
>
</
dependency
>
<!-- 包含web应用开发时,用到Spring框架时所需的核心类,包括自动载入WebApplicationContext -->
<
dependency
>
<
groupId
>
org.springframework
</
groupId
>
<
artifactId
>
spring-web
</
artifactId
>
<
version
>
${spring.version}
</
version
>
</
dependency
>
<!-- 包括SpringMVC框架用到的所有类 -->
<
dependency
>
<
groupId
>
org.springframework
</
groupId
>
<
artifactId
>
spring-
webmvc
</
artifactId
>
<
version
>
${spring.version}
</
version
>
</
dependency
>
<!-- 包括SpringTest对JUNIT等测试框架的简单封装 -->
<
dependency
>
<
groupId
>
org.springframework
</
groupId
>
<
artifactId
>
spring-test
</
artifactId
>
<
version
>
${spring.version}
</
version
>
</
dependency
>
<!-- 为Spring核心提供了大量扩展。可以找到使用spring
applicationcontext
特性时所需的全部类, instrumentation组件以及校验validation方面的相关类 -->
<
dependency
>
<
groupId
>
org.springframework
</
groupId
>
<
artifactId
>
spring-context
</
artifactId
>
<
version
>
${spring.version}
</
version
>
</
dependency
>
<!--
Servlet
Web -->
<
dependency
>
<
groupId
>
javax.servlet
</
groupId
>
<
artifactId
>
javax.servlet-
api
</
artifactId
>
<
version
>
3.1.0
</
version
>
<
scope
>
provided
</
scope
>
</
dependency
>
<!--
json
解析 -->
<
dependency
>
<
groupId
>
com.fasterxml.jackson.core
</
groupId
>
<
artifactId
>
jackson
-
databind
</
artifactId
>
<
version
>
2.8.7
</
version
>
</
dependency
>
<!-- Map工具类 对标准java Collection的扩展spring-core.jar需commons-collections.jar -->
<
dependency
>
<
groupId
>
commons-collections
</
groupId
>
<
artifactId
>
commons-collections
</
artifactId
>
<
version
>
3.2
</
version
>
</
dependency
>
<!-- DAO:Mybatis -->
<
dependency
>
<
groupId
>
org.mybatis
</
groupId
>
<
artifactId
>
mybatis
</
artifactId
>
<
version
>
3.4.2
</
version
>
</
dependency
>
<
dependency
>
<
groupId
>
org.mybatis
</
groupId
>
<
artifactId
>
mybatis
-spring
</
artifactId
>
<
version
>
1.3.1
</
version
>
</
dependency
>
<!--数据库 -->
<
dependency
>
<
groupId
>
mysql
</
groupId
>
<
artifactId
>
mysql
-connector-java
</
artifactId
>
<
version
>
5.1.37
</
version
>
</
dependency
>
<!--连接池 -->
<
dependency
>
<
groupId
>
c3p0
</
groupId
>
<
artifactId
>
c3p0
</
artifactId
>
<
version
>
0.9.1.2
</
version
>
</
dependency
>
</
dependencies
>
若需要其他jar包,可以自行下载
MAVEN仓库:http://mvnrepository.com/