我的“简单Spring Hibernate实用程序项目”中的一些import语句出错

时间:2012-12-28 06:54:08

标签: java spring hibernate spring-tool-suite

我正在使用Spring Tool Suite(STS)版本:3.1.0.RELEASE。我创建了一个“Spring Spring Project”作为“Simple Spring Hibernate Utility Project”。无法解析“HibernateConfiguration.java”文件中的以下import语句:

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

如何解决问题/错误?

1 个答案:

答案 0 :(得分:0)

在“pom.xml”中添加以下代码:

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