【发布时间】:2017-01-09 15:04:23
【问题描述】:
我在 Maven 环境中学习 Spring。我正在使用 netbeans。
pom.xml
<dependencies>
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.davidsalter.cookbook</groupId>
<artifactId>springMavenTest</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>4.3.4.RELEASE</version>
</dependency>
</dependencies>
</project>
并且 spring.context-4.3.4.RELEASE.jar 出现在 Dependencies 下。在 Java Dependencies 下我只有 JDK1.8。
当我必须使用@Configuration 和@Bean 注释在java 类中配置我的bean 时,我无法导入org.springframework。
【问题讨论】:
标签: java spring maven netbeans