I have observed the following maven behavior in my project which does not make sense to me. Here is the essence of what is going on.
Lets say I have a project with with two modules
- com.example.foo.jar
- com.example.bar.jar bar depends on foo
- both share a common parent project that is includes maven module
When my local .m2 is empty and therefore foo and bar are not installed.
- In the
project/
directorymvn clean verify
works and the build is successful - in
bar/
directorymvn initialize
does not work and I get an error message saying that maven could not resolve bar's dependency on foo
So why can maven build the project when I invoke it from the project folder but not from an individual module?
project/
pom.xml
foo/
pom.xml
bar/
pom.xml
I am trying to avoid the mvn install
hack discussed here http://developer-blog.cloudbees.com/2012/12/maven-and-hack.html