1. 原生java项目配置
1. 下载spring依赖包
2. 导入spring-core、spring-expression、springcontext、spring-beans内部依赖
3. 导入junit、commons-loggin外部依赖
4. 配置一个xml,命名随意

    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:p="http://www.springframework.org/schema/p"
        xsi:schemaLocation="http://www.springframework.org/schema/beans
            http://www.springframework.org/schema/beans/spring-beans.xsd">

            <!-- 添加beans位置 -->
  1. spring配置(IDEA举例)
    【可选操作,手动下载spring包】

    1. 新建spring项目,可选下载spring或指定spring包路径
      【可选操作, Create empoty spring-config.xml】
      注:自动创建空的spring的配置文件xml,命名为spring-config.xml【可手动创建】
    2. 根据错误,本人会提示缺少junit、commons-loggin外部依赖。
      【各个教程并未提及spring项目需要单独添加,但不添加项目无法运行@Test测试】
  2. maven配置
    1. 新建maven项目
    2. 在pom.xml中添加
      
      <dependencys>
          <dependency>
              <groupId>org.springframework</groupId>
              <artifactId>spring-context</artifactId>
              <version>5.2.3.RELEASE</version>
          </dependency>
          <!-- 外部依赖 -->
          <dependency>
              <groupId>junit</groupId>
              <artifactId>junit</artifactId>
              <version>4.13</version>
              <scope>test</scope>
          </dependency>
      </dependencys>
      
    3. 在项目资源目录(resources)添加 任意名称的spring配置xml
      <?xml version="1.0" encoding="UTF-8"?>
      <beans xmlns="http://www.springframework.org/schema/beans"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xmlns:p="http://www.springframework.org/schema/p"
          xsi:schemaLocation="http://www.springframework.org/schema/beans
              http://www.springframework.org/schema/beans/spring-beans.xsd">
              <!-- beans配置 -->
      </beans>
      
  3. 不同IDE配置问题
    IDEA可自动下载lib包,eclipse需要手动下载导入。
    或者使用spring官网的eclipse安装spring后的IDE

努力决定态度,态度决定高度.