Maven doesn't recognize sibling modules when running mvn dependency:tree
As discussed in this maven mailing list thread, the dependency:tree goal by itself will look things up in the repository rather than the reactor. You can work around this by mvn installing, as previously suggested, or doing something less onerous that invokes the reactor, such as
mvn compile dependency:tree
Works for me.
I think the problem is that when you specify a dependency Maven expects to have it as jar (or whatever) packaged and available from at least a local repo. I'm sure that if you run mvn install
on your commons project first everything will work.
Realizing this is an older thread but it seems that either the tool evolved or this might have been missed the first time around.
It is possible to perform a build that makes dependencies resolved without installing by doing a reactor build.
If you start your build in the parent that describes the module structure of your project then your dependencies between your modules will be resolved during the build itself through the internal Maven reactor.
Of course this is not the perfect solution since it does not solve the build of a single individual module within the structure. In this case Maven will not have the dependencies in his reactor and will bee looking to resolve it in the repository. So for individual builds you still have to install the dependencies first.
Here is some reference describing this situation.