Where should I put the main implementation in a project with several Maven modules?

I have a small (4 module) maven project with a pom root pom. Right now I have a module implthat contains basic methods and settings. This leads to some problems, for example, creating a single bank for the entire project (possibly) a huge list of dependencies containing all the modules, and confusion that tries to track the main method for future developers.

So, I think: is it better to use this material in the root project or to stay in its own module? Will there be any disadvantages associated with its implementation (for example, problems with plugins)?

+3
source share
2 answers

This leads to some problems, for example, the creation of a single bank for the entire project.

There are solutions for this (for example, using a dedicated module and Maven build plugin or Maven Shade plugin).

(possibly) a huge list of dependencies containing all the modules,

I do not understand what you are talking about here.

and confusion, trying to return to the main method for future developers.

Just document things if no one can transmit information.

So, I think: is it better to use this material in the root project or to stay in its own module? Will there be any disadvantages associated with its implementation (for example, problems with plugins)?

Steven correctly, aggregation and / or parent POMs must have type packaging pom, and you cannot embed any code in them.

+1

AFAIK, "pom", - .

, .

, .. JAR, . , Maven Shade.

+1

Source: https://habr.com/ru/post/1768811/


All Articles