Spring框架——IDEA下maven项目搭建spring环境
- 创建maven
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/86f7809bc7fa69504734c2f7712720cf.png)
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/9604748c776421203d7d70312b8d43f3.png)
- 配置pom.xml文件
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/07c2064f68efd2e82b513a2a602a3750.png)
将如下代码输入到pom.xml中
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>5.0.2.RELEASE</version>
</dependency>
</dependencies>
- 在resources下创建bean.xml并添加内容,内容和eclipse中bean.xml的内容一致
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/3f51dbd00b4fbc058c21504143062720.png)
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">
</beans>