Previously I have worked with multi-module Maven projects that consisted out of two hierarchies. The parent POM followed by modules in their own directories and POMs.
But now I have taken over a project that contains a parent, followed by modules which again contain modules.
Is this all according to Maven guidelines or am I dealing with something customized?
And how to I interpret these sub-modules? Know a guide you can point me to?
I can run all Maven lifecycles successfully. Though I'm unsure whether and how to refactor the application and start inserting my own code.
Here is a tree of my project structure with only a few modules left:
top-parent
| pom.xml (modules: applications, checks, core, test)
|
+---applications
| | pom.xml (parent: top-parent) (modules: batch, surefire, web)
| <parent>
| <artifactId>applications</artifactId>
| <groupId>com.a.b.codechecker</groupId>
| <version>1.0</version>
| </parent>
| <artifactId>batch</artifactId>
|
| |
| \---web
| | pom.xml
| <parent>
| <groupId>com.a.b.codechecker</groupId>
| <artifactId>applications</artifactId>
| <version>1.0</version>
| </parent>
| <artifactId>web</artifactId>
|
+---checks
| | pom.xml (parent: top parent) (modules: aggregator, blacklist-check)
| <parent>
| <groupId>com.a.b.codechecker</groupId>
| <artifactId>parent</artifactId>
| <version>1.0</version>
| </parent>
| <groupId>com.a.b.codechecker.checks</groupId>
| <artifactId>checks</artifactId>
| |
| +---aggregator
| | pom.xml
<parent>
<artifactId>checks</artifactId>
<groupId>com.a.b.codechecker.checks</groupId>
<version>1.0</version>
</parent>
<artifactId>aggregator</artifactId>
I provide below few outlines.
As per the question, Is this all according to Maven guidelines or am I dealing with something customized?
Yes, you can have Parent, Child, Grand child type module structure.Parent and Child type maven multi module hierarchy is simple, but in some cases, developers design to have several sub modules inside a module. If you have large project having n number of modules and m number of submodules, it becomes complex for different levels of developers.
As per this question, And how to I interpret these sub-modules? Know a guide you can point me to? It is upto the development team about how to manage for simplicity. I would recommend, if you have many sub modules, you can create/maintain another independent project and you can add the dependency to the main project wherever it is required. It will provide you the granularity and a separate team work on this project without considering the main project.
In case of large project, it is always recommended to maintain independent projects and you can add the dependency in other projects. For this you can use Nexus or Artifactory for artifact management.