title: How to handle sub projects dependencies in Maven
body: <p>My project is made of 5 sub projects. One is a War, and the other 4 are jars. Basically the war project needs all 4 jar projects, and their dependencies.</p>
  
  <p>I can strip down the dependencies to have something like war->A->B->C->D. Every sub project add their share of external dependencies (spring, struts, hibernate) so that in the end the war gets everything needed to run.</p>
  
  <p>This looks pretty well organised and square, but then I ask myself if this is very practical to make changes.</p>
  
  <p>Imagine I have to change one line of code in project D, without changing anything to its Maven dependencies. I would have to re-release project D obviously, but then I have to re-release projects C, B, A, and the war just to reflect this change in their pom files. This can be long and annoying, especially if you have to quickly release a new version to fix something in production.</p>
  
  <p>I could make the war depend on all 4 projects, so then I just have to change project D version number in the war pom file. But then I have project A depending indirectly on project D 1.0 and the war specifying project D 1.1. I think that the war direct dependency would win in that case wouldn't it ?</p>
  
  <p>This would make the new war release quicker, but it would also mess my sub projects dependencies, as they would be outdated.</p>
  
  <p>What would be an acceptable way to handle this situation ?</p>