1、父工程pom.xml
<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.0modelVersion>
<groupId>com.atguigugroupId>
<artifactId>pro-ssmartifactId>
<version>1.0-SNAPSHOTversion>
<module>pro04-spring-ioc-xmlmodule>
<maven.compiler.source>17maven.compiler.source>
<maven.compiler.target>17maven.compiler.target>
<project.build.sourceEncoding>UTF-8project.build.sourceEncoding>
<spring.version>6.0.6spring.version>
<junit.version>5.3.1junit.version>
<groupId>org.springframeworkgroupId>
<artifactId>spring-contextartifactId>
<version>${spring.version}version>
<groupId>org.junit.jupitergroupId>
<artifactId>junit-jupiter-apiartifactId>
<version>${junit.version}version>

2、子工程pom.xml
<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.0modelVersion>
<groupId>com.atguigugroupId>
<artifactId>pro-ssmartifactId>
<version>1.0-SNAPSHOTversion>
<artifactId>pro04-spring-ioc-xmlartifactId>
<maven.compiler.source>17maven.compiler.source>
<maven.compiler.target>17maven.compiler.target>
<project.build.sourceEncoding>UTF-8project.build.sourceEncoding>
<groupId>org.springframeworkgroupId>
<artifactId>spring-contextartifactId>
<groupId>org.junit.jupitergroupId>
<artifactId>junit-jupiter-apiartifactId>
3、Person.java
System.out.println("Hello Spring!");
4、applicationContext.xml
<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">
<bean id="p01" class="com.atguigu.ioc.Person">bean>
5、PersonTest.java
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.context.support.ClassPathXmlApplicationContext;
public class PersonTest {
BeanFactory beanFactory = new ClassPathXmlApplicationContext("applicationContext.xml");
Person p01 = (Person) beanFactory.getBean("p01");
