JAVA spring 常用包作用详解(转)

转载地址:https://www.cnblogs.com/Tmc-Blog/p/6093162.html

1<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 2 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 3 <modelVersion>4.0.0</modelVersion> 4 <groupId>zhuku.com</groupId> 5 <artifactId>ecommerce</artifactId> 6 <packaging>war</packaging> 7 <version>0.0.1-SNAPSHOT</version> 8 <name>ecommerce Maven Webapp</name> 9 <url>http://maven.apache.org</url> 10 <dependencies> 11 <dependency> 12 <groupId>junit</groupId> 13 <artifactId>junit</artifactId> 14 <version>3.8.1</version> 15 <scope>test</scope> 16 </dependency> 17 18 <!-- common相关包 --> 19 <!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 20 该版本完全支持 Java 5 的特性,例如泛型和可变参数 该版本无法兼容以前的版本 简化很多平时经常要用到的写法,例如判断字符串是否为空等等 --> 21 <dependency> 22 <groupId>org.apache.commons</groupId> 23 <artifactId>commons-lang3</artifactId> 24 <version>3.4</version> 25 </dependency> 26 <!-- https://mvnrepository.com/artifact/org.apache.commons/commons-pool2 27 对象池的实现,显著的提升了性能和可伸缩性,特别是在高并发加载的情况下 --> 28 <dependency> 29 <groupId>org.apache.commons</groupId> 30 <artifactId>commons-pool2</artifactId> 31 <version>2.4.2</version> 32 </dependency> 33 <!-- https://mvnrepository.com/artifact/org.apache.commons/commons-email 34 邮件 --> 35 <dependency> 36 <groupId>org.apache.commons</groupId> 37 <artifactId>commons-email</artifactId> 38 <version>1.4</version> 39 </dependency> 40 <!-- https://mvnrepository.com/artifact/org.apache.commons/commons-collections4 41 要求 Java 5 支持 源码和二进制不兼容 3.x 版本 使用了泛型以及 Java 5 的其他语言特性,如可变参数和迭代 移除了废弃的类和方法,这些类和方法已经被新的 42 JDK 所支持 使用 java.util.Queue 替代 Buffer 接口 --> 43 <dependency> 44 <groupId>org.apache.commons</groupId> 45 <artifactId>commons-collections4</artifactId> 46 <version>4.1</version> 47 </dependency> 48 <!-- https://mvnrepository.com/artifact/org.apache.commons/commons-io 有很多工具类,里面多数类都是完成文件操作以及字符串比较的功能 --> 49 <dependency> 50 <groupId>org.apache.commons</groupId> 51 <artifactId>commons-io</artifactId> 52 <version>1.3.2</version> 53 </dependency> 54 55 <!--/ common相关包 end --> 56 57 <!-- spring相关 --> 58 <!-- https://mvnrepository.com/artifact/org.springframework/spring-context 59 为Spring核心提供了大量扩展。可以找到使用Spring ApplicationContext特性时所需的全部类, JDNI所需的全部类, 60       UI方面的用来与模板(Templating)引擎如Velocity、FreeMarker、JasperReports 61 集成的类,以及校验Validation方面的相关类 --> 62 <dependency> 63 <groupId>org.springframework</groupId> 64 <artifactId>spring-context</artifactId> 65 <version>4.3.3.RELEASE</version> 66 </dependency> 67 <!-- https://mvnrepository.com/artifact/org.springframework/spring-context-support 68 含支持UI模版(Velocity,FreeMarker,JasperReports),邮件服务,脚本服务(JRuby),缓存Cache(EHCache), 69 任务计划Scheduling(uartz)方面的类。外部依赖spring-context, (spring-jdbc, Velocity, FreeMarker, 70 JasperReports, BSH, Groovy, JRuby, Quartz, EHCache) --> 71 <dependency> 72 <groupId>org.springframework</groupId> 73 <artifactId>spring-context-support</artifactId> 74 <version>4.3.3.RELEASE</version> 75 </dependency> 76 <!-- https://mvnrepository.com/artifact/org.springframework/spring-test 77 spring测试框架,需要配合 最顶部的junit进行使用创建单元测试。 spring测试所需包:sring的相关组件,spring test ,junit --> 78 <dependency> 79 <groupId>org.springframework</groupId> 80 <artifactId>spring-test</artifactId> 81 <version>4.3.3.RELEASE</version> 82 </dependency> 83 <!-- https://mvnrepository.com/artifact/org.springframework/spring-core 84 包含Spring 框架基本的核心工具类。Spring 其它组件要都要使用到这个包里的类, 是其它组件的基本核心,当然你也可以在自己的应用系统中使用这些工具类。 85 外部依赖Commons Logging, (Log4J)--> 86 <dependency> 87 <groupId>org.springframework</groupId> 88 <artifactId>spring-core</artifactId> 89 <version>4.3.3.RELEASE</version> 90 </dependency> 91 <!-- https://mvnrepository.com/artifact/org.springframework/spring-beans 92 所有应用都要用到的,它包含访问配置文件、创建和管理bean 以及 进行Inversion of Control / Dependency Injection(IoC/DI)操作相关的所有类。 93 如果应用只需基本的IoC/DI 支持,引入spring-core.jar 及spring-beans.jar 文件就可以了。 外部依赖spring-core,(CGLIB)--> 94 <dependency> 95 <groupId>org.springframework</groupId> 96 <artifactId>spring-beans</artifactId> 97 <version>4.3.3.RELEASE</version> 98 </dependency> 99 <!-- https://mvnrepository.com/artifact/org.springframework/spring-web 100 包含Web 应用开发时,用到Spring 框架时所需的核心类,包括自动载入Web Application Context 101 特性的类、Struts 与JSF 集成类、文件上传的支持类、Filter 类和大量工具辅助类。 102 外部依赖spring-context, Servlet API, (JSP API, JSTL, Commons FileUpload, COS)--> 103 <dependency> 104 <groupId>org.springframework</groupId> 105 <artifactId>spring-web</artifactId> 106 <version>4.3.3.RELEASE</version> 107 </dependency> 108 <!-- https://mvnrepository.com/artifact/org.springframework/spring-webmvc 109 包含Spring MVC 框架相关的所有类。包括框架的Servlets,Web MVC框架,控制器和视图支持。 110 当然,如果你的应用使用了独立的MVC 111 框架,则无需这个JAR 文件里的任何类。 112 外部依赖spring-web, (spring-support,Tiles,iText,POI)--> 113 <dependency> 114 <groupId>org.springframework</groupId> 115 <artifactId>spring-webmvc</artifactId> 116 <version>4.3.3.RELEASE</version> 117 </dependency> 118 <!-- https://mvnrepository.com/artifact/org.springframework/spring-jdbc 119 包含对Spring 对JDBC 数据访问进行封装的所有类。 外部依赖spring-beans,spring-dao。 --> 120 <dependency> 121 <groupId>org.springframework</groupId> 122 <artifactId>spring-jdbc</artifactId> 123 <version>4.3.3.RELEASE</version> 124 </dependency> 125 <!-- https://mvnrepository.com/artifact/org.springframework/spring-aop 126 AOP(Aspect Oriented Programming),即面向切面编程(也叫面向方面编程,面向方法编程)。 127 其主要作用是,在不修改源代码的情况下给某个或者一组操作添加额外的功能。像日志记录,事务处理, 128 权限控制等功能,都可以用AOP来“优雅”地实现,使这些额外功能和真正的业务逻辑分离开来, 129 软件的结构将更加清晰。AOPOOP的一个强有力的补充。 --> 130 <dependency> 131 <groupId>org.springframework</groupId> 132 <artifactId>spring-aop</artifactId> 133 <version>4.3.3.RELEASE</version> 134 </dependency> 135 <!-- https://mvnrepository.com/artifact/org.springframework/spring-tx 136 事物控制 --> 137 <dependency> 138 <groupId>org.springframework</groupId> 139 <artifactId>spring-tx</artifactId> 140 <version>4.3.3.RELEASE</version> 141 </dependency> 142 <!-- https://mvnrepository.com/artifact/org.springframework/spring-orm 143 包含Spring对DAO特性集进行了扩展,使其支持 iBATIS、JDOOJB、TopLink, 因为Hibernate已经独立成包了,现在不包含在这个包里了。这个jar文件里大部分的类都要 144 依赖spring-dao.jar里的类,用这个包时你需要同时包含spring-dao.jar包。 --> 145 <dependency> 146 <groupId>org.springframework</groupId> 147 <artifactId>spring-orm</artifactId> 148 <version>4.3.3.RELEASE</version> 149 </dependency> 150 <!-- https://mvnrepository.com/artifact/org.springframework/spring-aspects --> 151 <dependency> 152 <groupId>org.springframework</groupId> 153 <artifactId>spring-aspects</artifactId> 154 <version>4.3.3.RELEASE</version> 155 </dependency> 156 <!-- https://mvnrepository.com/artifact/org.springframework/spring-expression 157 SPEL表达式支持: 158 一、基本表达式:字面量表达式、关系,逻辑与算数运算表达式、字符串连接及截取表达式、 159 三目运算及Elivis表达式、正则表达式、括号优先级表达式; 160 二、类相关表达式:类类型表达式、类实例化、instanceof表达式、变量定义及引用、赋值表达式、 161 自定义函数、对象属性存取及安全导航表达式、对象方法调用、Bean引用; 162 三、集合相关表达式:内联List、内联数组、集合,字典访问、列表,字典,数组修改、集合投影、 163 集合选择;不支持多维内联数组初始化;不支持内联字典定义; 164 四、其他表达式:模板表达式。 165 注:SpEL表达式中的关键字是不区分大小写的。 166 --> 167 <dependency> 168 <groupId>org.springframework</groupId> 169 <artifactId>spring-expression</artifactId> 170 <version>4.3.3.RELEASE</version> 171 </dependency> 172 173 <!--/ spring相关 end --> 174 175 176 </dependencies> 177 <build> 178 <finalName>ecommerce</finalName> 179 </build> 180 <!-- 指定maven编译方式为jdk1.8版本 --> 181 <profiles> 182 <profile> 183 <id>jdk-1.8</id> 184 <activation> 185 <activeByDefault>true</activeByDefault> 186 <jdk>1.8</jdk> 187 </activation> 188 <properties> 189 <maven.compiler.source>1.8</maven.compiler.source> 190 <maven.compiler.target>1.8</maven.compiler.target> 191 <maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion> 192 </properties> 193 </profile> 194 </profiles> 195 196</project>
点赞
收藏

评论区

加载中...

相关推荐

手写Java HashMap源码

HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程22

springboot2.1整合mybatis

1:添加依赖<?xmlversion"1.0"encoding"UTF8"?<projectxmlns"http://maven.apache.org/POM/4.0.0"xmlns:xsi"http://www.w3.org/2001/XMLSchemainstance"xsi

SpringBoot2.0配置durid数据源

pom依赖<?xmlversion"1.0"encoding"UTF8"?<projectxmlns"http://maven.apache.org/POM/4.0.0"xmlns:xsi"http://www.w3.org/2001/XMLSchemainstance"

Spring boot 配置异步处理执行器

示例如下:1、新建Maven项目 asyncexecutor2、pom.xml<projectxmlns"http://maven.apache.org/POM/4.0.0"xmlns:xsi"http://www.w3.org/2001/XMLSchemainstance"xsi:sch

121 项目 034 笔记向 easyui

pom<?xmlversion"1.0"encoding"UTF8"?<projectxmlns"http://maven.apache.org/POM/4.0.0"xmlns:xsi"http://www.w3.org/2001/XMLSchemainstance"

121 项目 034 笔记向 easyui

pom<?xmlversion"1.0"encoding"UTF8"?<projectxmlns"http://maven.apache.org/POM/4.0.0"xmlns:xsi"http://www.w3.org/2001/XMLSchemainstance"