I have a Maven multi-module project. I want to define dependencies in the parent pom , (type pom, not jar)
and have sub-modules have the dependency in scope for the code I write. No matter what I do, I cannot get this to work.
Simply putting the dependency in the parent pom does not seem to work, I have to put it yet again in each sub-module.
You can define the dependency versions in parent POM but they are not auto injected. You have to specify the dependencies of the parent that you need in the current project along with their scope so that when maven 'bundles' your code it knows the dependencies(Compile or Provided) before hand. This also affects the size of your JAR file that will be generated