Lazy dependencies on a multi-project Maven project

We plan to use Maven to create a large multi-project project to give you an idea of ​​the size, some of the subprojects have several million lines of code.

The ideal structure would be something like this:

  • Projecta
    • module1
    • module2
  • projectB
    • moduleAlpha (depends on Beta module)
    • moduleBeta (depends on projectA: module1)
  • ...

Where each module is actually a maven sub-project, and the dependencies are not always at the artifact level (i.e. jars), but rather make the subproject compile as needed.

Adding a common project root allows you to express dependencies as described, for example:

  • Project-root
    • Projecta
      • module1
      • module2
    • projectB
      • moduleAlpha (depends on Beta module)
      • moduleBeta (depends on projectA: module1)
    • ...

. , , -, .

projectX moduleX.

( jar, 1), .

, . ( ).

- , , . , projectA - , projectB. - projectA, .

- Maven ? , ?

+3
1

( jar, 1), .

:

  • (), , ( Maven )
  • , , , Alpha moduleAlpha:

    mvn -pl moduleAlpha -am
    

- , , . , projectA - , projectB. - projectA, .

, , , JAR .

, SNAPSHOT . .

, Maven 3.x parallel builds.

+3

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


All Articles