问题
I have X maven project which has dependencies on Y maven project. If I make changes in Y project and build it, how to start X's build also without any manual intervention?
回答1:
I hope you mind you want to keep your X project up-to-date; so when you launch a new build of your Y project then the X project start a new compilation and takes the latest version of Y artifact. If so, the best way is to relay all these operations on a continuous integration strategy. In your case, for instance, you can set up a new configuration in Jenkins (you can install it in your local tomcat and just deploy the war Jenkins application on it) in which for every time Y project launches a new compilation the X project starts a new build taking the new Y version deployment libraries or whatever it shares in the maven repository. The result is that you will have always the X project aligned with the latest version on Y project. Anyway, you must assure you have defined and implemented regression test units either on both projects in order to detect how the new version behaves according to the current project specifications.
来源:https://stackoverflow.com/questions/28956977/how-do-to-manage-dependencies-between-different-maven-projects-globally