I originally asked this question regarding how should I organize my application: layers first or slices first: Multi-Module Web App with Spring and Maven
I'm leaning towards slices first, and thinking that a good way to keep it all neatly would be having:
As to whether it is possible to organize a maven project into one project with submodules, here are some important considerations when doing it in IntelliJ.
pom.xmlfiles and watch for changes to the project hierarchy. It will add new projects to the hierarchy for you, and prompt to remove the corresponding IntelliJ project when a maven project is removed from a parent
pom.xml. To enable this, search for "Import Maven projects automatically" in IntelliJ Preferences and enable it.
pom.xmlfiles, you can rebuild your IntelliJ projects from the
pom.xmlfiles if they get out of sync. Just re-open the parent
pom.xmlfile as a project, and IntelliJ will prompt you, asking if you want to delete the existing IntelliJ projects and recreate them. Tell it to do so, and you will be back in sync. This is sometimes useful if you use source control, and different versions of your source have different projects and subprojects.
For guidance on project structure, IntelliJ can help out with that too. In the Analyze menu, I would suggest enabling the following inspections: