IDEA copy project Module appears java folder source root solution

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
Insert image description here
. Add the name of the subproject in the modules of the parent file's pom file.
Insert image description here
Modify the subproject's pom and change the artifactId to a new name.
Insert image description here
After adding, the project Module has a blue logo, but there is a project name at the end.
Insert image description here
Right-click the project and select Rename under Refactor.
Insert image description here
Select Rename module and name it the same as before.
Insert image description here
After the change, the name is gone, and there is one last problem left. There is a source root behind the java folder.
Insert image description here
Select File -> Project Structure
Insert image description here

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.

Insert image description here
After deleting, mark the corresponding folder type on the pasted project folder and the problem will be solved.
Insert image description here
Finally, check the dependencies imported by maven to see if there are any problems. You are done~
Insert image description here

Guess you like

Origin blog.csdn.net/qq_41848006/article/details/128670574