mavenmaven-3maven-4

Main differences between Maven 3 and 4


Now that there is release candidate 2 of Maven 4.0.0 and things become more stable, I would like to know:

What are the main differences between Maven 3.x and 4.0.0 for Maven users (and Maven plugin developers)?

I tried to have a look at release notes and the Maven homepage, but I am a bit overwhelmed. A lot information is about the internal structure of Maven, and there is a huge number of issues in the issue tracker that are resolved, but I did find any good information that summarizes the main improvements and breaking changes.


Solution

  • Main points are:

    1. Separation of build POM and consumer POM. The build POM gets a new model version, while the consumer POM, generated during the build, still uses 4.0.0
    2. Better handling of modules (now called subprojects), less duplication of version numbers.
    3. A new packaging type bom for Bills of Materials.
    4. Improved lifecycle which allows to handle things happening before and after certain phases.
    5. A Maven shell that allows faster execution of Maven commands.

    See also https://maven.apache.org/whatsnewinmaven4.html, thanks to Karl-Heinz Marbaise for the link.