Working with Multiple Maven Projects Simultaneously
Project 1: Foo Project 2: Bar
If Foo depends on Bar, and both are in Maven, how do you work on Bar and Foo, so that if you need to make a small tweak in Bar, in order to fix something in Foo you can ma开发者_JAVA技巧ke that change to Bar and then run Foo and see that change?
Right now I have the Maven dependency, but I feel like deploying to maven and incrementing the snapshot for small changes in a currently unreleased project seems a bit wrong, how do you work on two maven projects at the same time, and ensure that a change to a dependency is immediately available to the project that is dependent?
Use m2eclipse and it's workspace resolution feature. All maven dependencies that can be mapped to projects inside the eclipse workspace will automatically be resolved as eclipse project references, hereby always letting you use the current version.
This is very handy for developing, but you have to remember to deploy things in the right order.
I would create a reactor build for those two projects.
root (pom with modules project1, project2)
+-- project1
+-- project2
So this will handle that problem very well.
精彩评论