How to find the library containing org.springframework.stereotype.Service?

Attempt to import import org.springframework.stereotype.Service; I get can not resolve the character stereotype. As far as I understand, I should get the necessary dependency using Maven.

However ... how do you know which dependency to get - that is, the name of the dependency? That is, which library contains this library and how do I know?

Thanks!

+12
spring maven
source share
5 answers

This is the spring-context jar that you need. Add the following to your maven dependencies:

 <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> <version>4.0.6.RELEASE</version> </dependency> 

This example provides a link to the latest version of the currently available jar, but you must match the version with the correct spring version.

+13
source share

You can use this site: http://www.findjar.com/

Just after the name of your class (all way org.spri ...)

+3
source share

Google search

org.springframework.stereotype.Service jar

and then search here to configure maven dependencies

+1
source share

You need to import this dependency into Maven:

 <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> </dependency> 

Note that the version number may be omitted if you use the parent Spring Boot module:

 <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>1.4.3.RELEASE</version> </parent> 

where 1.4.3.RELEASE is the latest version of Spring Boot.

+1
source share

Make sure you create DynamicWebProject if you are using a Java project and add that the Maven dependency will not work. In any case, you do not need a separate dependency, its part spring -context is already

 <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> <version>4.3.2.RELEASE</version> </dependency> 
0
source share

All Articles