Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is Spring's Minimum Dependencies for Dependency Injection?

What are the minimum dependencies required to just use Spring's dependency injection (core framework only)? I'm using Spring for a standalone application, and I'd like to minimize the number of dependencies that I have to ship with the application.

I suppose I could systematically remove a Jar and see if the application breaks, but it would be much better if someone had a definitive answer.

Oh, and I'm using Spring 2.5.

like image 592
Jim Hurne Avatar asked May 18 '09 11:05

Jim Hurne


People also ask

What are the minimum dependencies required to run any Spring boot project?

Dependencies, inherited from the spring-boot-dependencies POM. Sensible resource filtering. Sensible plugin configuration.

What are the dependencies required for Spring MVC?

Spring MVC Dependencies to pom. We need to add spring-web and spring-webmvc dependencies in pom. xml, also add servlet-api, jsp-api and jstl dependencies.

How many ways are there to achieve dependency injection in Spring?

There are two types of Spring Dependency Injection. They are: Setter Dependency Injection (SDI): This is the simpler of the two DI methods. In this, the DI will be injected with the help of setter and/or getter methods.

Which injection is used for mandatory dependencies?

Constructor based Injection -When container call the constructor of the class. It should be used for mandatory dependencies.


1 Answers

Check out the readme.txt that comes with the download of Spring 2.5.

Assuming you don't have AOP, JDBC, Transactions, or ORM, then your best bet is probably:

  • spring-core
  • spring-beans
  • spring-context
like image 119
toolkit Avatar answered Oct 13 '22 20:10

toolkit