Detailed description of files and various jar packages in the spring package

Source: Internet
Author: User

Aspectj directory
The source code and test program files of aspectj are used in the Spring framework. Aspectj is the earliest application framework for providing AOP in Java.
Dist directory
Next is the spring release package. The release package is described in detail below.
Docs directory
The following are related documents, including javadoc for spring API, reference Reference Guide, spring label library usage files, and MVC-step-by-step explanations and examples of spring MVC. They are all good documents. It is worth studying.
Lib directory
Next is the third-party open source package on which spring depends.
Mock directory
Below is the mock source program for spring-assisted application testing.
Samples Directory
The following is the sample source code of spring and the sample configuration of the simple webapp sample framework. It is worth learning about jpetstore and petclinic, of course, other countries, imagedb, and tiles-example can also be referenced.
Src directory
Below is the source program of spring.
Test directory
Spring unit test source program.
Tiger directory
The following is the source program and test program for using Java 1.5 in the Spring framework. Tiger is the development code of JDK 1.5.

Next, let's talk about the jar package in the DIST directory in detail. Understanding this helps us reduce the size of the release package and increase our understanding of the spring architecture.

Spring. Jar
Is a single jar package that contains a complete release module. But does not include mock. jar, aspects. jar, spring-portlet.jar, and spring-hibernate2.jar.

Spring-src.zip is all the source code compressed package.

Except spring. JAR file. Spring also includes 21 other independent jar packages, each containing the corresponding spring components. You can choose to combine your own jar packages as needed, instead of introducing the entire spring. jar.

Spring-core.jar

This jar file contains the basic core tool class of the Spring framework. Other components of spring must use the class in this package, which is the basic core of other components. Of course, you can also use these tool classes in your own application system.
The external dependency is commons logging (log4j ).

Spring-beans.jar

This jar file is used by all applications. It includes access to the configuration file, creation and management of beans, and inversion of control/
Dependency injection (IOC/di) operations related to all classes. If the application only needs the basic IOC/di
Yes, just introduce spring-core.jar and spring-beans.jar files.
The external dependency is spring-core, (cglib ).

Spring-aop.jar

This jar file contains the class and source code-level metadata support required when spring's AOP feature is used in applications. Use spring features based on AOP, such as declarative transaction management, to include the jar package in the application.
The external dependency is spring-core, (spring-beans, AOP alliance, cglib, commons attributes ).

Spring-context.jar

This jar file provides a large number of extensions for the spring core. You can find all the classes required to use the spring applicationcontext feature, all the classes required by jdni, the instrumentation component, and related classes for validation.
The external dependency is spring-beans (spring-AOP ).

Spring-dao.jar

This jar file contains all classes for data access by spring Dao and Spring transaction. To use declarative transaction support, you also need to include spring-aop.jar in your own applications.
The external dependency is spring-core, (spring-AOP, spring-context, jta api ).

Spring-jdbc.jar

This jar file contains all classes that encapsulate spring's JDBC data access.
The external dependency is spring-beans and spring-Dao.

Spring-support.jar

This jar file contains classes that support UI templates (velocity, freemarker, jasperreports), email service, script Service (jruby), cache (ehcache), and Task Plan Scheduling (uartz.
External Dependency on spring-context, (spring-JDBC, velocity, freemarker, jasperreports, bsh, groovy, jruby, quartz, ehcache)

Spring-web.jar

This jar file contains the core classes required to use the Spring framework for Web application development, this includes automatic loading of Web application context features, Struts and JSF integration classes, file upload support classes, filter classes, and a large number of tool-assisted classes.
The external dependency is spring-context, Servlet API, (jsp api, jstl, commons fileupload, cos ).

Spring-webmvc.jar

This jar file contains all classes related to the spring MVC framework. Includes the framework Servlets, Web MVC Framework, controller and view support. Of course, if your application uses an independent MVC framework, you do not need any classes in the jar file.
The external dependency is spring-web, (spring-support, tiles, itext, poi ).

Spring-portlet.jar

A framework similar to spring MVC implemented by spring itself. Includes an MVC Framework and controller.
The external dependency is spring-web and Portlet API (spring-webmvc ).

Spring-struts.jar

Struts framework support makes it easier to integrate the Struts framework.
The external dependency is spring-web and struts.

Spring-remoting.jar

This jar file contains classes that support EJB, remote call remoting (RMI, Hessian, burlap, HTTP invoker, JAX-RPC.
External Dependency spring-AOP, (spring-context, spring-web, Hessian, burlap, JAX-RPC, ejb api ).

Spring-jmx.jar

This jar package provides support classes for JMX 1.0/1.2.
External dependencies include spring-beans, spring-AOP, and JMX APIs.

Spring-jms.jar

This jar package provides support classes for JMS 1.0.2/1.1.
External dependencies include spring-beans, spring-Dao, and JMS APIs.

Spring-jca.jar

Support for JCA 1.0.
The external dependency is spring-beans, spring-Dao, and JCA APIs.

Spring-jdo.jar

Support for JDO 1.0/2.0.
The external dependency is spring-JDBC, jdo api, (spring-Web ).

Spring-jpa.jar

Support for JPA 1.0.
The external dependency is spring-JDBC, jpa api, (spring-Web ).

Spring-hibernate2.jar

We do not recommend hibernate 2.1 Support.
The external dependency is spring-JDBC, hibernate2, (spring-Web ).

Spring-hibernate3.jar

Support for hibernate 3.0/3.1/3.2.
The external dependency is spring-JDBC, hibernate3, (spring-Web ).

Spring-toplink.jar

Support for the toplink framework.
The external dependency is spring-JDBC and toplink.

Spring-ibatis.jar

Support for ibatis SQL maps.
The external dependency is spring-JDBC and ibatis SQL maps.

The other two packages.

Spring-mock.jar

This jar file contains a complete set of mock classes from spring to assist in application testing. Spring testing suite uses a large number of mock
Class to make the test easier. Simulate the httpservletrequest and httpservletresponse classes on the Web
Application unit testing is very convenient. And provides support for JUnit.
The external dependency is spring-core.

Spring-aspects.jar

Provides support for aspectj so that you can easily integrate aspect-oriented functions into the IDE, such as Eclipse ajdt.
External Dependency.

Weaver jars (Dist/weavers) description.

Spring-agent.jar

Spring's instrumentationsavingagent (instrumentationloadtimeweaver) is a device proxy package. For more information, see the instrumentation function of jdk1.5.
External Dependency none (for use at JVM startup: "-javaagent: spring-agent.jar ").

Spring-tomcat-weaver.jar

Extends Tomcat classloader so that it can use the instrumentation (device) class.
External Dependency none (for deployment into Tomcat's "server/lib" directory ).

To use JSP as the parameter of spring's Web MVC tags, JSP 2.0 is required. Or select jstl (standard. Jar) of Jakarta ).

The selection of these release packages is actually quite simple. If you are building a web
The application will use spring throughout the process, so it is best to use a single all spring. jar file; if your application only uses simple inversion
Control/dependency
Injection (IOC/di) container, then just spring-core.jar with spring-beans.jar
If you have high requirements on the release size, you have to select the JAR file that contains the required features.
File. With an independent release package, you can avoid including all the classes that your application does not need.
Of course, you can use other tools to make sure that the entire application package is smaller. The focus of space saving is to find out the spring dependency classes you need accurately, then merge the required classes and packages. Eclispe has a plug-in named classpathhelper to help you find the dependent class.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.