This is a very crucial part of automation, especially for parent-child project structure in POM-based automation. I also faced a similar issue when I worked on a project related to data quality testing. We have created a core framework that contains all the actions, drivers, utilities, etc. The purpose was to use this core framework in the automation of multiple projects. When I tried to use this core framework in the automation of the core project, I used the below steps to resolve that.
Let's consider, your Parent project's POM looks like this:
<groupId>com.abc</groupId>
<artifactId>xyz</artifactId>
<version>0.0.1-SNAPSHOT</version>
Run mvn clean install in the command prompt on the parent project directory. This will create a jar file of your parent project and place it in the .m2 repository of your user's folder in C drive.
Next Step, open the child's project POM file and add the above jar file as a dependency in it as mentioned below:
<dependency>
<groupId>com.abc</groupId>
<artifactId>xyz</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
Now, you will be able to use all the classes of the parent project in the child project. Hope this information is helpful for you. Thanks!!!!!