How to move a module under a main module?
Answered
How can I modify a simple project with only one module to be a group of related modules?
So I want to create an empty parent module with my current module inside that module and then start a second module under the same parent.
When I try to add a module it gets created as a submodule of my existing module so I can't figure out how to create the "parent module" so I can move my current module under it.
Please sign in to leave a comment.
Modules cannot share the same roots. They should be placed side by side, not one under another.
Yes that is what I am trying to do. But when I add a module it places it inside my current module because I created that module originally in the root folder.
So I am trying to figure out now how I can change my structure.
So for example I started my project called Dashboard with all the source right under it.
Dashboard/src
Dashboard/pom.xml
Dashboard/target
etc
Now I want to change the structure to
Dashboard/DashboardLib (Where this contains the original module which just builds some common sharable classes)
Dashboard/DashboardTestUI (Where this is a new heavy UI module I want to test the other module)
Does that make more sense now? Sorry I am not exactly sure how to explain this well.
Create a new project in a new directory (without modules). Move the existing module to a subdirectory of this project (without .idea directory).
Import the existing module to the new project.
Add a new module in another subdirectory to the same project.
Got it... steps I took
1) created new empty folder Dashboard
2) Intellij Created new "Empty Project" called Dashboard with the folder I just created as it's root
3) created subfolder in Dashboard called DashboardLib and copied all files from original project into this directory excluding the .idea directory.
4) imported module from source and selected my pom.xml file to import the project.
5) created new module called called TestDashboard and with root folder of /Dashboard/TestDashboard
Now they are side by side as you say. I think this looks right now.
Thanks