maven nested modules

following up with, there are times it needs a set up of nested modules.

where for example, module A could contain module A1, module A2 for example.

the needed changes/set up for nested maven module is similar to the multi module set up. however, now module A needs to be with



similarly, the submodule should be included in module A.



among the submodules, if A1 needs to use the code from ACore, the dependency scope should be compile, so that it would build A1 shaded with the classes from ACore.




this will work out within IDE. as for build or packaging, the command to build the nested jars are

mvn clean package -pl ModuleA-am -amd

-am will include upstream dependency for example module Core

where -amd will include the nested modules, for example ACore, A1 and A2.

One thought on “maven nested modules

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s