cuiyi's blog(崔毅 crazycy)

记录点滴 鉴往事之得失 以资于发展
数据加载中……

Download of Spring Framework

Spring has upgrade their website as spring.io

And the download of zip files has become a bit confusion.
Base on 
You now have to download the zip files form their repository, as stated here: 
https://github.com/spring-projects/spring-framework/wiki/Downloading-Spring-artifacts 
(statement at the bottom of the page).

Download cannot proceed without account/login, so I decide to the below page and download jar by jar.
mvnrepository.com/artifact/org.springframework

When come to "spring-security-core", I question myself that how I can get all dependent jar files.
With this question, I find the direct link to download the whole zip file:
http://repo.spring.io/release/org/springframework/spring
or
https://github.com/spring-projects/spring-framework/releases

Also, there is another DIY solution from Spring website 
https://github.com/spring-projects/spring-framework/wiki/Downloading-Spring-artifacts
(statement at the bottom of the page).
Also, some folks are already provided the detailed steps:
The solution I prefer is using Maven, it is easy and you don't have to download each jar alone. you can do it with the following steps:

1. Create an empty folder in anywhere with any name you prefer, for example spring-source
2. Create a new file named pom.xml
3. Copy the following in this file
4. Open the spring-source folder in your console
5. Run mvn install
6. After download finished, you'll find spring jars in /spring-source/target/dependencies
Configuration is as below:
<project>
  <modelVersion>4.0.0</modelVersion>
  <groupId>spring-source-download</groupId>
  <artifactId>SpringDependencies</artifactId>
  <version>1.0</version>
  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>
  <repositories>
    <repository>
      <id>repository.spring.release</id>
  <name>Spring GA Repository</name>
      <url>http://repo.spring.io/release</url>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </repository>
  </repositories>
  <dependencies>
    <!--each dependency refer to
           corresponding project under 
http://spring.io/projects-->
  <!--spring-framework-->
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context</artifactId>
        <version>4.0.0.RELEASE</version>
    </dependency>
    <!--spring-security-->
  <!--
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
<version>3.2.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
<version>3.2.0.RELEASE</version>
</dependency>
-->
<!--spring-webflow-->
<!--
<dependency>
<groupId>org.springframework.webflow</groupId>
<artifactId>spring-webflow</artifactId>
<version>2.3.2.RELEASE</version>
    </dependency>
-->
</dependencies>
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-dependency-plugin</artifactId>
            <version>2.8</version>
            <executions>
              <execution>
                <id>download-dependencies</id>
                  <phase>generate-resources</phase>
                    <goals>
                      <goal>copy-dependencies</goal>
                    </goals>
                    <configuration>
                      <outputDirectory> ${project.build.directory}/dependencies </outputDirectory>
                    </configuration>
              </execution>
            </executions>
      </plugin>
    </plugins>
  </build>
</project>
Furthermore, 
Also, if you need to download any other spring project, just copy the dependency configuration from its corresponding web page

For example, if you want to download Spring Web Flow jars, go to its web page, and add its dependency configuration to the pom.xml dependencies, then run mvn install again.
<dependency>
   <groupId>org.springframework.webflow</groupId>
    <artifactId>spring-webflow</artifactId>
    <version>2.3.2.RELEASE</version>
</dependency>


引用一个文章:如何在项目中引入Spring框架(2010-05-26)

spring的jar包说明如下:

>>spring.jar 
是包含有完整发布模块的单个jar 包。
但是不包括mock.jar, aspects.jar, spring-portlet.jar, and spring-hibernate2.jar。
      
spring-src.zip就是所有的源代码压缩包。

除了spring.jar 文件,Spring 还包括有其它21 个独立的jar 包,各自包含着对应的Spring组件,用户可以根据自己的需要来选择组合自己的jar 包,而不必引入整个spring.jar 的所有类文件。

>>spring-core.jar
这个jar 文件包含Spring 框架基本的核心工具类。Spring 其它组件要都要使用到这个包里的类,是其它组件的基本核心,当然你也可以在自己的应用系统中使用这些工具类。

外部依赖Commons Logging, (Log4J)。

>>spring-beans.jar
这个jar 文件是所有应用都要用到的,它包含访问配置文件、创建和管理bean 以及进行Inversion of Control / Dependency Injection(IoC/DI)操作相关的所有类。如果应用只需基本的IoC/DI 支持,引入spring-core.jar 及spring-beans.jar 文件就可以了。

外部依赖spring-core,(CGLIB)。

>>spring-aop.jar
这个jar 文件包含在应用中使用Spring的AOP 特性时所需的类和源码级元数据支持。使用基于AOP 的Spring特性,如声明型事务管理(Declarative Transaction Management),也要在应用里包含这个jar包。

外部依赖spring-core, (spring-beans,AOP Alliance, CGLIB,Commons Attributes)。

>>spring-context.jar
这个jar 文件为Spring核心提供了大量扩展。可以找到使用Spring ApplicationContext特性时所需的全部类,JDNI 所需的全部类,instrumentation组件以及校验Validation 方面的相关类。

外部依赖spring-beans, (spring-aop)。

>>spring-dao.jar
这个jar 文件包含Spring DAO、Spring Transaction 进行数据访问的所有类。为了使用声明型事务支持,还需在自己的应用里包含spring-aop.jar。
      
外部依赖spring-core,(spring-aop, spring-context, JTA API)。

>>spring-jdbc.jar
这个jar 文件包含对Spring 对JDBC 数据访问进行封装的所有类。

外部依赖spring-beans,spring-dao。

>>spring-support.jar
这个jar 文件包含支持UI模版(Velocity,FreeMarker,JasperReports),邮件服务,脚本服务(JRuby),缓存Cache(EHCache),任务计划Scheduling(uartz)方面的类。

外部依赖spring-context, (spring-jdbc, Velocity, FreeMarker, JasperReports, BSH, Groovy, JRuby, Quartz, EHCache)

>>spring-web.jar
这个jar 文件包含Web 应用开发时,用到Spring 框架时所需的核心类,包括自动载入Web Application Context 特性的类、Struts 与JSF 集成类、文件上传的支持类、Filter 类和大量工具辅助类。

外部依赖spring-context, Servlet API, (JSP API, JSTL, Commons FileUpload, COS)。

>>spring-webmvc.jar
这个jar 文件包含Spring MVC 框架相关的所有类。包括框架的Servlets,Web MVC框架,控制器和视图支持。当然,如果你的应用使用了独立的MVC 框架,则无需这个JAR 文件里的任何类。

外部依赖spring-web, (spring-support,Tiles,iText,POI)。

>>spring-portlet.jar
spring自己实现的一个类似Spring MVC的框架。包括一个MVC框架和控制器。

外部依赖spring-web, Portlet API,(spring-webmvc)。

>>spring-struts.jar
Struts框架支持,可以更方便更容易的集成Struts框架。

外部依赖spring-web,Struts。

>>spring-remoting.jar
这个jar 文件包含支持EJB、远程调用Remoting(RMI、Hessian、Burlap、Http Invoker、JAX-RPC)方面的类。

外部依赖spring-aop, (spring-context,spring-web,Hessian,Burlap,JAX-RPC,EJB API)。

>>spring-jmx.jar
这个jar包提供了对JMX 1.0/1.2的支持类。      

外部依赖spring-beans,spring-aop, JMX API。

>>spring-jms.jar
这个jar包提供了对JMS 1.0.2/1.1的支持类。

外部依赖spring-beans,spring-dao,JMS API。

>>spring-jca.jar
对JCA 1.0的支持。

外部依赖spring-beans,spring-dao, JCA API。

>>spring-jdo.jar
对JDO 1.0/2.0的支持。      

外部依赖spring-jdbc, JDO API, (spring-web)。

>>spring-jpa.jar
对JPA 1.0的支持。

外部依赖spring-jdbc, JPA API, (spring-web)。

>>spring-hibernate2.jar
对Hibernate 2.1的支持,已经不建议使用。

外部依赖spring-jdbc,Hibernate2,(spring-web)。

>>spring-hibernate3.jar
对Hibernate 3.0/3.1/3.2的支持。

外部依赖spring-jdbc,Hibernate3,(spring-web)。

>>spring-toplink.jar
对TopLink框架的支持。

外部依赖spring-jdbc,TopLink。

>>spring-ibatis.jar
对iBATIS SQL Maps的支持。

外部依赖spring-jdbc,iBATIS SQL Maps。

>>spring-mock.jar
这个jar 文件包含Spring 一整套mock 类来辅助应用的测试。Spring 测试套件使用了其中大量mock 类,这样测试就更加简单。模拟HttpServletRequest 和HttpServletResponse 类在Web 应用单元测试是很方便的。并且提供了对JUnit的支持。

外部依赖spring-core。

>>spring-aspects.jar
提供对AspectJ的支持,以便可以方便的将面向方面的功能集成进IDE中,比如Eclipse AJDT。

外部依赖。


WEAVER JARS (dist/weavers)说明:

>>spring-agent.jar
Spring的InstrumentationSavingAgent (为InstrumentationLoadTimeWeaver),一个设备代理包,可以参考JDK1.5的Instrumentation功能获得更多信息。

外部依赖none (for use at JVM startup: "-javaagent:spring-agent.jar")。

>>spring-tomcat-weaver.jar
扩展Tomcat的ClassLoader,使其可以使用instrumentation(设备)类。

外部依赖none (for deployment into Tomcat's "server/lib" directory)。

如果需要使用JSP语言作为Spring's web MVC tags的参数,则需要JSP 2.0的支持。或者选择Jakarta的JSTL (standard.jar)。

posted on 2014-01-06 19:08 crazycy 阅读(846) 评论(0)  编辑  收藏 所属分类: JavaEE技术


只有注册用户登录后才能发表评论。


网站导航: