开发者

Do we have to install/deploy parent maven module to use submodule?

开发者 https://www.devze.com 2023-02-08 19:47 出处:网络
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 su

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

0

精彩评论

暂无评论...
验证码 换一张
取 消