How should dependencies be managed in maven

Multi module projects in maven are a great thing. But have you ever faced issues with multi module projects.

With lots of smaller services and 1 parent for all the services. Some services at any point may need different dependencies or different versions of same dependencies.

So it be better have <optional> on dependencies that are shared by common projects.

And exclude all the dependencies when importing common projects. That can help with having with version conflicts. But may lead to runtime issues as some libs may be missing.

Leave a Comment