Juano7894
Juano7894

Reputation: 830

What is the difference between spring-context and spring-core dependencies?

Hello I am new to the Spring and maven world, and I want to know what is the difference between this 2 dependencies?

Its a simple question.. I am having trouble with my pom.xml file, so I want to know everything :).

Thanks in advance.

Upvotes: 46

Views: 31087

Answers (2)

amit
amit

Reputation: 21

Spring-core is basic building block for Spring that in conjunction with Spring Beans provides dependency injection and IoC features.

Spring Context provides access to configured objects like a registry (a context). It inherits its features from Spring Beans and adds support for internationalization, event propagation, resource loading, and the transparent creation of contexts.

Upvotes: 0

Michał Kalinowski
Michał Kalinowski

Reputation: 17983

These are actually 2 of many Spring Framework modules. You can easily find what packages these artifacts contain, using this site:

http://mvnrepository.com/artifact/org.springframework/spring-core/3.1.1.RELEASE

This can give you information about classes contained within a particular artifact and probably about the its purpose.

For Spring Framework, spring-core contains mainly core utilities and common stuff (like enums) and because it's really critical for Spring, probably all other Spring modules depend on it (directly or transitively).

In turn spring-context provides Application Context, that is Spring's Dependency Injection Container and it is probably always defined in POMs of artifacts that use Spring Framework somehow. In fact, spring-context depends on spring-core so by defining spring-context as your dependency, you have spring-core in your classpath as well.

Upvotes: 53

Related Questions