I have several maven-projects:
- commons-lib (simple Java project)
- user-service (Spring-Boot-driven project)
- composite-service (Spring-Boot-driven project)
- frontend-service (Spring-Boot- / Angular2-driven project)
- all-services-parent (parent project building everything else)
While commons-lib is unlikely to ever be released separately, all other projects (except for the parent) might be released separately.
If the first four in the list are sub-modules of the fifth, do they have to have their parent set to parent (e.g. all-services-parent) in return?
Since I want to include commons-lib in the user- and composite-services I understand that I have to have it built first. However: each of the services above may be released separately - so which building structure is most proper for what I need?
Would it be:
-- all-services-parent
|-- (maven sub-module) commons-lib
|-- (maven sub-module) user-service
|-- (maven sub-module) composite-service
|-- (maven sub-module) frontend-service
or:
-- all-services-parent
|-- user-service-parent
|-- (maven sub-module) commons-lib
|-- (maven sub-module) user-service
|-- composite-service-parent
|-- (maven sub-module) commons-lib
|-- (maven sub-module) composite-service
|-- frontend-service
The second building structure would allow me to build all the JARs by calling "mvn clean install" on all-services-parent while still being able to build separate projects properly by calling "mvn clean install" on the corresponding parent, but is it really how it's done?
In my current setup I am trying to use the first building structure, but since e.g. composite-service has "spring-boot-starter-parent" set as its parent, I cannot access the properties or anything from the "all-services-parent"-module.
I read into Maven parent pom vs modules pom (a question that looked promising at first), but it did not apply to my case as much as I would like it to.