JAVA spring 經常使用包做用詳解(轉)

轉載地址:https://www.cnblogs.com/Tmc-Blog/p/6093162.htmlhtml

<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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>zhuku.com</groupId>
    <artifactId>ecommerce</artifactId>
    <packaging>war</packaging>
    <version>0.0.1-SNAPSHOT</version>
    <name>ecommerce Maven Webapp</name>
    <url>http://maven.apache.org</url>
    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>3.8.1</version>
            <scope>test</scope>
        </dependency>

        <!-- common相關包 -->
        <!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 
            該版本徹底支持 Java 5 的特性,例如泛型和可變參數 該版本沒法兼容之前的版本 簡化不少平時常常要用到的寫法,例如判斷字符串是否爲空等等 -->
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>3.4</version>
        </dependency>
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-pool2 對象池的實現,顯著的提高了性能和可伸縮性,特別是在高併發加載的狀況下 --> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-pool2</artifactId> <version>2.4.2</version> </dependency>
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-email 郵件 --> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-email</artifactId> <version>1.4</version> </dependency>
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-collections4 要求 Java 5 支持 源碼和二進制不兼容 3.x 版本 使用了泛型以及 Java 5 的其餘語言特性,如可變參數和迭代 移除了廢棄的類和方法,這些類和方法已經被新的 JDK 所支持 使用 java.util.Queue 替代 Buffer 接口 --> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-collections4</artifactId> <version>4.1</version> </dependency>
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-io 有不少工具類,裏面多數類都是完成文件操做以及字符串比較的功能 --> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-io</artifactId> <version>1.3.2</version> </dependency> <!--/ common相關包 end --> <!-- spring相關 --> <!-- https://mvnrepository.com/artifact/org.springframework/spring-context 爲Spring核心提供了大量擴展。能夠找到使用Spring ApplicationContext特性時所需的所有類, JDNI所需的所有類,        UI方面的用來與模板(Templating)引擎如Velocity、FreeMarker、JasperReports 集成的類,以及校驗Validation方面的相關類 --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> <version>4.3.3.RELEASE</version> </dependency> <!-- https://mvnrepository.com/artifact/org.springframework/spring-context-support 含支持UI模版(Velocity,FreeMarker,JasperReports),郵件服務,腳本服務(JRuby),緩存Cache(EHCache), 任務計劃Scheduling(uartz)方面的類。外部依賴spring-context, (spring-jdbc, Velocity, FreeMarker, JasperReports, BSH, Groovy, JRuby, Quartz, EHCache) --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context-support</artifactId> <version>4.3.3.RELEASE</version> </dependency> <!-- https://mvnrepository.com/artifact/org.springframework/spring-test spring測試框架,須要配合 最頂部的junit進行使用建立單元測試。 spring測試所需包:sring的相關組件,spring test ,junit --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-test</artifactId> <version>4.3.3.RELEASE</version> </dependency> <!-- https://mvnrepository.com/artifact/org.springframework/spring-core 包含Spring 框架基本的核心工具類。Spring 其它組件要都要使用到這個包裏的類, 是其它組件的基本核心,固然你也能夠在本身的應用系統中使用這些工具類。 外部依賴Commons Logging, (Log4J)。 --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-core</artifactId> <version>4.3.3.RELEASE</version> </dependency> <!-- https://mvnrepository.com/artifact/org.springframework/spring-beans 全部應用都要用到的,它包含訪問配置文件、建立和管理bean 以及 進行Inversion of Control / Dependency Injection(IoC/DI)操做相關的全部類。 若是應用只需基本的IoC/DI 支持,引入spring-core.jar 及spring-beans.jar 文件就能夠了。 外部依賴spring-core,(CGLIB)。 --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-beans</artifactId> <version>4.3.3.RELEASE</version> </dependency> <!-- https://mvnrepository.com/artifact/org.springframework/spring-web 包含Web 應用開發時,用到Spring 框架時所需的核心類,包括自動載入Web Application Context 特性的類、Struts 與JSF 集成類、文件上傳的支持類、Filter 類和大量工具輔助類。 外部依賴spring-context, Servlet API, (JSP API, JSTL, Commons FileUpload, COS)。 --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-web</artifactId> <version>4.3.3.RELEASE</version> </dependency> <!-- https://mvnrepository.com/artifact/org.springframework/spring-webmvc 包含Spring MVC 框架相關的全部類。包括框架的Servlets,Web MVC框架,控制器和視圖支持。 固然,若是你的應用使用了獨立的MVC 框架,則無需這個JAR 文件裏的任何類。 外部依賴spring-web, (spring-support,Tiles,iText,POI)。 --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> <version>4.3.3.RELEASE</version> </dependency> <!-- https://mvnrepository.com/artifact/org.springframework/spring-jdbc 包含對Spring 對JDBC 數據訪問進行封裝的全部類。 外部依賴spring-beans,spring-dao。 --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-jdbc</artifactId> <version>4.3.3.RELEASE</version> </dependency> <!-- https://mvnrepository.com/artifact/org.springframework/spring-aop AOP(Aspect Oriented Programming),即面向切面編程(也叫面向方面編程,面向方法編程)。 其主要做用是,在不修改源代碼的狀況下給某個或者一組操做添加額外的功能。像日誌記錄,事務處理, 權限控制等功能,均可以用AOP來「優雅」地實現,使這些額外功能和真正的業務邏輯分離開來, 軟件的結構將更加清晰。AOP是OOP的一個強有力的補充。 --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-aop</artifactId> <version>4.3.3.RELEASE</version> </dependency> <!-- https://mvnrepository.com/artifact/org.springframework/spring-tx 事物控制 --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-tx</artifactId> <version>4.3.3.RELEASE</version> </dependency> <!-- https://mvnrepository.com/artifact/org.springframework/spring-orm 包含Spring對DAO特性集進行了擴展,使其支持 iBATIS、JDO、OJB、TopLink, 由於Hibernate已經獨立成包了,如今不包含在這個包裏了。這個jar文件裏大部分的類都要 依賴spring-dao.jar裏的類,用這個包時你須要同時包含spring-dao.jar包。 --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-orm</artifactId> <version>4.3.3.RELEASE</version> </dependency> <!-- https://mvnrepository.com/artifact/org.springframework/spring-aspects --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-aspects</artifactId> <version>4.3.3.RELEASE</version> </dependency> <!-- https://mvnrepository.com/artifact/org.springframework/spring-expression SPEL表達式支持: 1、基本表達式:字面量表達式、關係,邏輯與算數運算表達式、字符串鏈接及截取表達式、 三目運算及Elivis表達式、正則表達式、括號優先級表達式; 2、類相關表達式:類類型表達式、類實例化、instanceof表達式、變量定義及引用、賦值表達式、 自定義函數、對象屬性存取及安全導航表達式、對象方法調用、Bean引用; 3、集合相關表達式:內聯List、內聯數組、集合,字典訪問、列表,字典,數組修改、集合投影、 集合選擇;不支持多維內聯數組初始化;不支持內聯字典定義; 4、其餘表達式:模板表達式。 注:SpEL表達式中的關鍵字是不區分大小寫的。 --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-expression</artifactId> <version>4.3.3.RELEASE</version> </dependency> <!--/ spring相關 end --> </dependencies> <build> <finalName>ecommerce</finalName> </build> <!-- 指定maven編譯方式爲jdk1.8版本 --> <profiles> <profile> <id>jdk-1.8</id> <activation> <activeByDefault>true</activeByDefault> <jdk>1.8</jdk> </activation> <properties> <maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.target>1.8</maven.compiler.target> <maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion> </properties> </profile> </profiles> </project>
相關文章
相關標籤/搜索