Bukama commented on code in PR #598:
URL: https://github.com/apache/maven-site/pull/598#discussion_r1921023562


##########
content/markdown/whatsnewinmaven4.md:
##########
@@ -0,0 +1,465 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<head>
+   <title>What's new in Maven 4?</title>
+   <meta name="author" content="Matthias Bünger" />
+</head>
+
+# What's new in Maven 4?
+
+Maven is over 20 years old, and is one of the most used build tools in the 
Java world.
+Throughout the years, one important rule has been maintaining the highest 
backward compatibility possible, especially of
+its [POM file][2] with Model version 4.0.0.
+
+The POM file fulfills two elementary needs.
+First, the POM holds all the information and configuration, which are only 
needed to build the artifact.
+After the artifact is created, this build information is not relevant anymore.
+Second, the POM also contains information, e.g. dependencies, which are needed 
by projects which want to use the
+artifact.
+These dependent projects are called the "consumers" (of an artifact).
+
+This made the Maven more than a tool; it became a whole ecosystem with many 
dependencies on the POM, especially the
+Maven Central repository, other build tools, and IDEs.
+This results in the situation that any change in the POM's schema forces each 
participant of the ecosystem to either
+adopt the change or drop support.
+Thus, the Maven POM syntax became fixed, unable to change.
+
+> "With the Maven build schema preserved in amber, we can’t evolve much: we’ll 
stay forever with Maven 3 minor releases,
+>
+>> unable to implement improvements that we imagine will require seriously 
updating the POM schema…"
+>> &mdash; <cite>[Hervé Boutemy (in Javaadvent 2021)][1]</cite>
+
+But Maven should be able to advance.
+For this, one important thing that's needed is to separate the information 
needed for the build from the information
+needed by the consumers, but without breaking the ecosystem.
+Maven 4 prepares for this and more.
+
+This article presents and explains major changes brought by Maven 4, grouped 
into several topics.
+
+## POM Changes
+
+### Build-POM and Consumer-POM
+
+Maven 3 uses Model version 4.0.0 not only by the build but also by consumers 
of the artifact.
+However, several parts of the POM are only necessary for the build while 
others, like the dependencies, are also
+needed by the consumers.
+Maven 4 therefore differentiates between a "Build-POM" and a "Consumer-POM".
+As the names suggest, the "Build-POM" contains all information needed to build 
the artifact, e.g., applied plugins
+and their configuration, while the "Consumer-POM", which is created during the 
Maven build, only contains what is
+necessary to use an artifact as a dependency.
+This POM will only keep what is really needed to use the artifact, e.g., 
dependency information.
+
+**Note**: See below for a comparison of the content of both POMs.
+
+### Model version 4.1.0
+
+With two types of POM, Maven 4 can make additions to the Build-POM as it is 
only be used by Maven.
+Therefore, with Maven 4, a new Model version 4.1.0 is introduced.
+This version adds some new elements and attributes, while others are marked as 
deprecated.
+To not break the ecosystem, this version is only available for the Build-POM, 
while the Consumer-POM will still use
+version 4.0.0.
+Maven generates the Consumer-POM during the build from the build POM.
+
+**Note**: Maven 4 will continue to build your model version 4.0.0 project.
+There is no need to update your POMs to 4.1.0 as long as you don't want to 
make use of the new features.
+
+### Modules are now subprojects
+
+From the early days of Maven 1 until today, all build information is stored in 
the POM, short for "Project Object
+Model".
+Together with build folders and other files, the wording "Maven project" is 
used.
+However, for projects containing multiple parts, e.g., an API and a client, 
each of those parts was called a "module"

Review Comment:
   I rephrased the section and added example. However I left out a `groupId` in 
this, because it's not needed. Maven will build subprojects as long as they are 
listed as such (and existent ofc), but a subproject does not need to have the 
same `groupId` or have the higher project configured as parent (verified with 
Maven 4 RC2)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to