You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Dmitry Skavish <sk...@gmail.com> on 2009/04/14 23:56:27 UTC

how to force a rebuild of a module dependent on a module with changes

Hello,
I am having some trouble making maven work as regular make and I believe I
am missing something obvious.

I have a root project: say R and two subproject (modules): A & B. B depends
on A. All versions in all the projects are specified with –SNAPSHOT.

Now B is using some class from A. If I change that class in A, but don’t
change anything in B and then run “mvn install” it will recompile A, but it
won’t recompile B (because nothing changed there) and the repository ends up
with version of B which uses obsolete version of this class from A.

If I do “mvn clean install” it works, but it’s expensive to do it on a
regular basis (at least on a big project).

Basically I want to just invoke “mvn somegoal” on a root project so that it
picks up all the changes and dependencies and rebuilds what needs to be
rebuilt. In this case it should figure out that it needs to rebuild B as
well because it's dependency changed. I believe it tries to rebuild B, but
since nothing changed there it does not recompile it.

I tried reactor plugin but it's essentially the same, it does not recompile
B in this case.

Thank you!

-- 
Dmitry Skavish