I have seen a project which uses Maven submodules. The project itself is a spring boot application that exposes Restful API endpoints for a microservice ex: Customer Service (getCustomers, createCustomers etc); consisting of standard model classes, repository, service interface&implementations, controllers etc.
Is there a good reason why we want to make model classes, repository, service interface&implementations, controllers, submodules ?
To be clear, i'm comparing these 2:
1) Normal case:
Project
src
main
java
dao
model
service
controller
resources
test
...
pom.xml
2) Submodules case:
Project
dao
src
main
java
dao
resources
test
...
pom.xml
service
src
main
java
service
resources
test
...
pom.xml
Why go for no 2?
To me this structure looks really complex with each pom.xml in each submodule folder..