custom pom.xml filename in maven multimodule

僤鯓⒐⒋嵵緔 提交于 2019-12-04 02:13:11
Krunal Shah

You can override default pom.xml. Maven have -f command option.

mvn -f <path>/pom.xml clean install

I would suggest to change the folder structure into the following.

root (pom.xml)
  +-- closed-core
  +-- closed-web
  +-- closed-webserver
  +-- closed-spring
  +-- lgpl-reactor
         +-- lgpl-lib
         +-- lgpl-dist
         +-- lgpl-etc..

Than you don't need a separte module-pom.xml file. You can work with pom.xml as default.

If you wan't to build lgpl-reactory you can simply give:

mvn -pl lgpl-reactory clean package 

if you have dependencies within the other modules to lgpl you can use:

mvn -am -pl lgpl-reactory clean package 

This will build also all dependent modules.

A solution is to apply the inverse logic, and use "mvn -f standalone-pom.xml clean package" to build lgpl-reactor as a standalone project ... But it'll be better if standalone project is build with a standard maven2 command line.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!