赞
踩
spring结构图
spring分为5个部分:core、aop、data access、web、test
官方给出总共20个JAR包,spring JAR包依赖的jar包下载地址:http://repo.spring.io/release/org/springframework/spring/
1、spring-core:依赖注入IoC与DI的最基本实现
2、spring-beans:Bean工厂与bean的装配
3、spring-context:spring的context上下文即IoC容器,包含两个JAR包,对应spring-context和spring-context-support-,其中support是spring额外支持包,比如邮件服务、视图解析等功能
4、spring-expression:spring表达式语言
因为spring-core依赖了commons-logging,而其他模块都依赖了spring-core,所以整个spring框架都依赖了commons-logging,如果有自己的日志实现如log4j,可以排除对commons-logging的依赖,没有日志实现而排除了commons-logging依赖:如下
- <dependency>
-
- <groupId>org.springframework</groupId>
-
- <artifactId>spring-core</artifactId>
-
- <version>4.1.7.RELEASE</version>
-
- <exclusions>
-
- <exclusion>
-
- <groupId>commons-logging</groupId>
-
- <artifactId>commons-logging</artifactId>
-
- </exclusion>
-
- </exclusions>
-
- <dependency>
1、spring-aop:面向切面编程
2、spring-aspects:集成AspectJ
3、spring-instrument:提供一些类级的工具支持和ClassLoader级的实现,用于服务器,对应spring-instrument,同时提供针对tomcat的instrument实现jar包spring-instrument-tomcat
4、spring-messaging:用于构建基于消息的应用程序
1、spring-jdbc:jdbc的支持
2、spring-tx:事务控制
3、spring-orm:对象关系映射,集成orm框架
4、spring-oxm:对象xml映射
5、spring-jms:java消息服务
1、spring-web:基础web功能,如文件上传
2、spring-webmvc:mvc实现
3、spring-webmvc-portlet:基于portlet的mvc实现
4、spring-websocket:为web应用提供的高效通信工具
1、spring-test:spring测试,提供junit与mock测试功能
我这里以4.1.7.RELEASE版本为例:
pom配置:
- <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>com.xp</groupId>
- <artifactId>xpro</artifactId>
- <version>0.0.1-SNAPSHOT</version>
- <properties>
- <!-- spring.version -->
- <spring.version>4.1.7.RELEASE</spring.version>
- </properties>
- <dependencies>
- <!-- spring-core:依赖注入IoC与DI的最基本实现 -->
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-core</artifactId>
- <version>${spring.version}</version>
- </dependency>
-
- <!-- spring-beans:Bean工厂与bean的装配 -->
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-beans</artifactId>
- <version>${spring.version}</version>
- </dependency>
-
- <!-- spring-context:spring的context上下文即IoC容器, 包含二个JAR包:spring-context和spring-context-support,
- 其中support是spring额外支持包,比如邮件服务、视图解析等 -->
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-context</artifactId>
- <version>${spring.version}</version>
- </dependency>
-
- <!-- spring-expression:spring表达式语言 -->
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-expression</artifactId>
- <version>${spring.version}</version>
- </dependency>
-
- <!-- spring-expression:spring表达式语言 -->
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-expression</artifactId>
- <version>${spring.version}</version>
- </dependency>
-
- <!-- spring-aop:面向切面编程 -->
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-aop</artifactId>
- <version>${spring.version}</version>
- </dependency>
-
- <!-- spring-aspects:集成AspectJ -->
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-aspects</artifactId>
- <version>${spring.version}</version>
- </dependency>
-
- <!-- spring-instrument:提供一些类级的工具支持和ClassLoader级的实现,
- 用于服务器,对应spring-instrument.jar,同时提供针对tomcat的instrument实现jar包
- spring-instrument-tomcat.jar -->
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-instrument</artifactId>
- <version>${spring.version}</version>
- </dependency>
-
- <!-- spring-messaging:用于构建基于消息的应用程序 -->
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-messaging</artifactId>
- <version>${spring.version}</version>
- </dependency>
-
- <!-- spring-messaging:用于构建基于消息的应用程序 -->
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-messaging</artifactId>
- <version>${spring.version}</version>
- </dependency>
-
- <!-- spring-jdbc:jdbc的支持 -->
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-jdbc</artifactId>
- <version>${spring.version}</version>
- </dependency>
-
- <!-- spring-tx:事务控制 -->
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-tx</artifactId>
- <version>${spring.version}</version>
- </dependency>
-
- <!-- spring-orm:关系映射 -->
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-orm</artifactId>
- <version>${spring.version}</version>
- </dependency>
-
- <!-- spring-oxm:对象xml映射 -->
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-oxm</artifactId>
- <version>${spring.version}</version>
- </dependency>
-
- <!-- spring-jms:java消息服务 -->
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-jms</artifactId>
- <version>${spring.version}</version>
- </dependency>
-
- <!-- spring-web:基础web功能,如文件上传 -->
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-web</artifactId>
- <version>${spring.version}</version>
- </dependency>
-
- <!-- spring-webmvc:mvc实现 -->
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-webmvc</artifactId>
- <version>${spring.version}</version>
- </dependency>
-
- <!-- spring-webmvc-portlet:基于portlet的mvc实现 -->
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-webmvc-portlet</artifactId>
- <version>${spring.version}</version>
- </dependency>
-
- <!-- spring-websocket:为web应用提供的高效通信工具 -->
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-websocket</artifactId>
- <version>${spring.version}</version>
- </dependency>
-
- <!-- spring-test:spring测试 -->
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-test</artifactId>
- <version>${spring.version}</version>
- </dependency>
- </dependencies>
- </project>
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。