Maven - How to build multiple Independent Maven projects from one project

后端 未结 2 769
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-13 14:26

I have 3 maven projects

  • WebComponents
  • DataComponents
  • ServiceComponents

When i build each of the projects i have to go into eac

2条回答
  •  猫巷女王i
    2020-12-13 14:59

    You're looking for Maven aggregation without inheritance. As shown in the referenced page, you just create a new POM whose packaging is "pom" and which has a list of "modules". A module is a relative path to another Maven project:

    
      ...
      pom
      ...
      
        foo 
        ../bar 
        ../../../other-projects/baz 
      
    
    

    Default behavior when building such a pom--known as an "aggregator"--is to build all of the modules as if you'd executed Maven in each module directory with the same arguments.

提交回复
热议问题