lets say we have a ParentPom.xml and there are sub child modules under it; subModule-A and subModule-B. I want to use subModule-A.jar in an another project. If i run "mvn install" command only in subModule-A directory i can install it into my M2 repository but after i define dependency to it from my other project it says something "no parent found for subModule-A开发者_如何学编程". It is OK if i run install command for ParentPom.xml.
Any idea about this problem?
Thx...
You need to install / deploy all modules that are referenced by submodule-A, including the parent.
You can do it like this:
mvn deploy -pl submodule-a -am
Which translates to
- deploy module submodule (
-pl submodule-a
) - and all of it's dependencies in the current reactor project (
-am
)
Call mvn -help
to see all possible command line options
精彩评论