Maven: Why deploy an aggregating POM?

Philipp

In my Maven setup, I have the following directory structure

.
|-- parent
|   `-- pom.xml
|-- module1
|   |-- src...
|   `-- pom.xml 
|-- more modules...
`-- pom.xml

Each module's pom has the parent/pom.xml as a parent, to regroup general information (eg. distributionManagement)

The root pom.xml is just to allow a one-click build & deploy of all modules, so it has packaging pom and lists all modules.

When I call "deploy" on the root pom, all builds and deploys well, but at the very end, it fails for the root project itself (because it lacks a distributionManagement element).

Why does Maven want to build and deploy that root pom? In my understanding, it's just some sort of shortcut to build all modules. There is really nothing to deploy or no project relevant data in it.

Can and should I try to avoid deployment of that pom?

Note: the workaround of adding a distributionManagement to the root pom, or make the root pom itself inherit from the parent/pom.xml are solutions to the build problem - I'm now more interested to understand if this is really necessary and why.

blackbuild

If your root pom is nowhere in the ancestry of your functional modules (i.e. your parent does not have root as its parent), then you could skip deployment of the aggregator by setting the maven.deploy.skip property to true inside your root pom.

That way, deployment would be skipped for root (it would still be "built", however).

However, I would simply deploy it as well. Give it some meaningfull coordinates (we use something like com.mycorp.aggregator-only:xy-aggregator:0-SNAPHSHOT). SNAPSHOT Version is important, because otherwise, your artifact repository would block repeated builds.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Maven: Why deploy an aggregating POM?

From Dev

Maven - why can't I override the version of a dependencyManagement imported pom?

From Dev

Adding AspectJ to pom.xml changed Java version with Maven, why?

From Dev

Why is maven running the same pom differently on two computers?

From Dev

Maven deploy configs in pom.xml VS jenkins post-build action

From Dev

Maven deploy two jars with different classifiers from two separate pom.xml

From Dev

How to configure the maven-release-plugin in pom to mimic -Dgoals=deploy on the command line

From Dev

Maven deploy configs in pom.xml VS jenkins post-build action

From Dev

Maven deploy two jars with different classifiers from two separate pom.xml

From Dev

How to deploy war to Tomcat from child pom using maven tomcat plugin?

From Dev

Deploy to glassfish from parent pom

From Dev

Artifactory or Nexus deploy Jar and Pom

From Dev

Maven package effective pom

From Dev

maven update pom property

From Dev

maven pom xml variables

From Dev

Disable distributionManagement in Maven POM

From Dev

Analyze Maven pom with SonarQube

From Dev

Scratch building a Maven POM

From Dev

Maven "conditional" parent POM?

From Dev

Why is maven dependency being added automatically to pom when using Eclipse (STS 3.5.1)?

From Dev

Why does Intellij freeze upon maven pom changes only when the project panel is showing?

From Dev

Maven: Why can I run mvn checkstyle:checkstyle without pom.xml config?

From Dev

Maven - How/Why/Should it work to set the parent version to be based on a property defined in the parent pom?

From Dev

Why does Intellij freeze upon maven pom changes only when the project panel is showing?

From Dev

Unable to deploy maven to Github

From Dev

Maven Wildfly remote deploy

From Dev

Maven site deploy issue

From Dev

Setting Maven for Artifactory deploy

From Dev

Deploy maven project to tomcat

Related Related

  1. 1

    Maven: Why deploy an aggregating POM?

  2. 2

    Maven - why can't I override the version of a dependencyManagement imported pom?

  3. 3

    Adding AspectJ to pom.xml changed Java version with Maven, why?

  4. 4

    Why is maven running the same pom differently on two computers?

  5. 5

    Maven deploy configs in pom.xml VS jenkins post-build action

  6. 6

    Maven deploy two jars with different classifiers from two separate pom.xml

  7. 7

    How to configure the maven-release-plugin in pom to mimic -Dgoals=deploy on the command line

  8. 8

    Maven deploy configs in pom.xml VS jenkins post-build action

  9. 9

    Maven deploy two jars with different classifiers from two separate pom.xml

  10. 10

    How to deploy war to Tomcat from child pom using maven tomcat plugin?

  11. 11

    Deploy to glassfish from parent pom

  12. 12

    Artifactory or Nexus deploy Jar and Pom

  13. 13

    Maven package effective pom

  14. 14

    maven update pom property

  15. 15

    maven pom xml variables

  16. 16

    Disable distributionManagement in Maven POM

  17. 17

    Analyze Maven pom with SonarQube

  18. 18

    Scratch building a Maven POM

  19. 19

    Maven "conditional" parent POM?

  20. 20

    Why is maven dependency being added automatically to pom when using Eclipse (STS 3.5.1)?

  21. 21

    Why does Intellij freeze upon maven pom changes only when the project panel is showing?

  22. 22

    Maven: Why can I run mvn checkstyle:checkstyle without pom.xml config?

  23. 23

    Maven - How/Why/Should it work to set the parent version to be based on a property defined in the parent pom?

  24. 24

    Why does Intellij freeze upon maven pom changes only when the project panel is showing?

  25. 25

    Unable to deploy maven to Github

  26. 26

    Maven Wildfly remote deploy

  27. 27

    Maven site deploy issue

  28. 28

    Setting Maven for Artifactory deploy

  29. 29

    Deploy maven project to tomcat

HotTag

Archive