Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I find the library containing org.springframework.stereotype.Service?

Tags:

spring

maven

Trying to import import org.springframework.stereotype.Service; I get cannot resolve symbol stereotype. As I understand it, I should be able to get the required dependency using Maven.

However... how do I find out which dependency to get -- i.e. the name of the dependency? That is, which library contains this library and how would I go about finding out?

Thanks!

like image 849
abc32112 Avatar asked Aug 08 '14 15:08

abc32112


4 Answers

It's the spring-context jar that your 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 is referencing the latest version of the jar available at the moment but you should match the version with the version of spring that you want.

like image 53
dectarin Avatar answered Nov 12 '22 16:11

dectarin


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

Just past your class name (entire path org.spri...)

like image 20
Mickaël P Avatar answered Nov 12 '22 15:11

Mickaël P


You need to import this dependency in Maven:

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

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

<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.

like image 2
Jämes Avatar answered Nov 12 '22 17:11

Jämes


Google search

org.springframework.stereotype.Service jar

and then do a search here for the maven dependency configuration

like image 1
AlexGreg Avatar answered Nov 12 '22 15:11

AlexGreg