When we often copy projects, there will be problems such as the module name has not changed, or there is a source root behind the java folder, or the maven parent-child project has no identity (as shown below). Here I will solve it one by one for you. If it is a maven parent-child project, you will need it
. Add the name of the subproject in the modules of the parent file's pom file.
Modify the subproject's pom and change the artifactId to a new name.
After adding, the project Module has a blue logo, but there is a project name at the end.
Right-click the project and select Rename under Refactor.
Select Rename module and name it the same as before.
After the change, the name is gone, and there is one last problem left. There is a source root behind the java folder.
Select File -> Project Structure
Find Modules and find the copied project. Note that it is a copied project. Here is the copied mybatis-03. Click the two gray Xs behind the right bottom to delete the path.
After deleting, mark the corresponding folder type on the pasted project folder and the problem will be solved.
Finally, check the dependencies imported by maven to see if there are any problems. You are done~