custom pom.xml filename in maven multimodule

前端 未结 3 979
暗喜
暗喜 2021-01-04 10:00

I have a maven3 multimodule project, and for a strange reason i need to customize POM filename for one of my child module (ie: module-pom.xml)

Is it possible to conf

相关标签:
3条回答
  • 2021-01-04 10:32

    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.

    0 讨论(0)
  • 2021-01-04 10:45

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

    mvn -f <path>/pom.xml clean install
    
    0 讨论(0)
  • 2021-01-04 10:45

    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.

    0 讨论(0)
提交回复
热议问题