In a Maven project, what are the reasons for a nested or flat catalog layout?

As my Maven project grows, I try to stay on top of the project structure. So far I have a layout of a subdirectory with 2-3 levels, where at each level there is POM with elements modulecorresponding to directories at this level. POM inheritance (property parent) does not necessarily follow this and is not relevant to the purpose of this question.

Now that the nested structure seems pretty natural to Maven, and it is beautiful and clean as long as you are at one specific level, I begin to confuse what I look in my IDE (Eclipse and IntelliJ IDEA).

I looked at the sources of Apache Felix, and they have a rather complicated project in what seems like a flat directory structure, so I wonder if it would be better.

What are some of the pros and cons for any approach that you have experienced in practice?

Note that this question (which I found in the meantime) seems to be very similar. I will leave this to the community to decide if it should be closed as a duplicate.

+3
source share
2 answers

. ( , , VCS) , . svn:externals . .

+1

. IDEA 9, , . ( 8.1 - .)

, - . , myapp-layer-component, , -, . , ( , ) .

, . db, . , - , , - -pl maven proejcts. cd db mvn.

,

myapp-web-gui1
myapp-web-gui2
myapp-web-base
myapp-svc-clustered
myapp-svc-clustered-integrationtest
myapp-svc-simple
myapp-db-model
myapp-db-hibernate

\myapp
   \web
     \gui1
        pom.xml
     \gui2
        pom.xml  (other poms omitted to keep it short)
     \base
   \svc
      \clustered
      \clustered-it
      \simple
   \db
      \model
      \hibernate      

, , .

( ...)

, , , . ( artifactIds.) SCM, . , , artifactId, SCM , .

+1

Source: https://habr.com/ru/post/1746569/


All Articles