Minimum JARs for Spring 3.0 dependency injection

20,146

Solution 1

As stated in another answer, maven is the true path. If; however, you choose to stray, then based on section "1.2.1 Core Container" of the Spring Reference I believe these to be the minimum jars for core spring functionality:

  • org.springframework.asm-3.0.4.RELEASE.jar
  • org.springframework.beans-3.0.4.RELEASE.jar
  • org.springframework.context-3.0.4.RELEASE.jar
  • org.springframework.core-3.0.4.RELEASE.jar
  • org.springframework.expression-3.0.4.RELEASE.jar

Edited: sorted the list, using wiki formatting.

Updated for Spring 3.2: It seems that asm is not part of the 3.2 distribution. Below is the list for Spring 3.2:

  • spring-beans-3.2.0.RELEASE.jar
  • spring-context-3.2.0.RELEASE.jar
  • spring-core-3.2.0.RELEASE.jar
  • spring-expression-3.2.0.RELEASE.jar

Solution 2

the best - and reliable way - of establishing this is to create a maven project and add dependency for spring-core, spring-bundle and spring-context. when you build/install this project maven will do the needful.

Share:
20,146

Related videos on Youtube

Alaska
Author by

Alaska

Updated on May 07, 2020

Comments

  • Alaska
    Alaska almost 4 years

    Similarly to this question regarding an earlier Spring version, what are the minimum dependencies required for an application to use Spring 3.0 dependency injection only? The application context will be configured by XML only. Spring depends on a logging framework, so assume I already include these JARs for logging:

    • jcl-over-slf4j.jar
    • logback-classic.jar
    • logback-core.jar
    • slf4j-api.jar
  • Alaska
    Alaska over 13 years
    I never used Maven and I'm not inclined to start. By adding one JAR at a time until a tiny test application can load a ClassPathXmlApplicationContext, I came up with the same Spring modules you listed but with org.springframework.asm-3.0.4.RELEASE.jar as an additional run-time dependency. If you edit your answer to add this JAR, I will accept the answer.
  • AngerClown
    AngerClown over 13 years
    Just because the jar is included by Maven doesn't mean you always need it. I usually end up excluding some jars manually, especially commons-logging now that I use slf4j.
  • MCory
    MCory over 11 years
    I know I'm late to this little party, but thank you -- this has always been one of my main stumbling blocks for using Spring for anything other than a web project; it's an awesome framework, but I hate the fact that it's so huge and there's such little documentation on what libraries are required for what feature.
  • PM 77-1
    PM 77-1 over 10 years
    RE: ...asm.jar: See D.3 Inlining of spring-asm jar section at [static.springsource.org/spring/docs/3.2.x/…
  • Kanagavelu Sugumar
    Kanagavelu Sugumar almost 5 years
    Does that mean without above four jars, dependency injection can not be achieved? am i correct?