tags:

views:

31

answers:

2

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 make 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?

+2  A: 

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.

seanizer
I use netbeans :)
walnutmon
well I don't, so I can't help you here, but I hear that the netbeans maven support is excellent, so there should be a similar feature...
seanizer
well, I am using the netbeans plug-in which kind of does this, although you still need to deploy changes, but that's a minor inconvenience
walnutmon
+1  A: 

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.

khmarbaise