Maven naming conventions for hierarchical multiple module projects

后端 未结 3 950
后悔当初
后悔当初 2021-01-30 21:58

I\'ve got a question on Maven naming conventions (groupId, artifactId and directory names) in a multiple module project with a hierarchical directory structrure.

Resear

3条回答
  •  天命终不由人
    2021-01-30 22:27

    In earlier days with maven I followed the following structure which you have described:

    appname
      +--- appname-module1
      +--- appname-module2
                  +--- appname-module2-chhild1
                  +--- appname-module2-chhild2
      +--- appname-module3
    

    But this will become ridiculous if you get more levels.

    So I decided to change my mind and now using things like:

    appname
      +--- module1
      +--- module2
              +--- chhild1
                     +--- subchild1
              +--- chhild2
      +--- module3
    

    The only thing which I change through the levels is the groupId...

    appname (groupId: com.soebes.appname)
      +--- module1 (groupId: com.soebes.appname.module1)
      +--- module2 (groupId: com.soebes.appname.module2)
              +--- chhild1 (groupId: com.soebes.appname.module1.child1)
              +--- chhild2 (groupId: com.soebes.appname.module1.child2)
      +--- module3 (groupId: com.soebes.appname.module3)
    

提交回复
热议问题