JAVA spring 常用包作用


<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表達式支持: 
            一、基本表達式:字面量表達式、關系,邏輯與算數運算表達式、字符串連接及截取表達式、
                三目運算及Elivis表達式、正則表達式、括號優先級表達式; 
            二、類相關表達式:類類型表達式、類實例化、instanceof表達式、變量定義及引用、賦值表達式、
                自定義函數、對象屬性存取及安全導航表達式、對象方法調用、Bean引用; 
            三、集合相關表達式:內聯List、內聯數組、集合,字典訪問、列表,字典,數組修改、集合投影、
                集合選擇;不支持多維內聯數組初始化;不支持內聯字典定義; 
            四、其他表達式:模板表達式。 
            注: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>

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM