BHARGAV-RUE commented on code in PR #1594:
URL: https://github.com/apache/maven-site/pull/1594#discussion_r3756874083
##########
content/markdown/guides/mini/guide-maven-classloading.md:
##########
@@ -47,32 +52,85 @@ It contains only Plexus Classworlds and imports the
platform classloader.
The second classloader down the graph contains the core requirements of Maven.
**It is used by Maven internally but not by plugins**. The core classloader has
the libraries in `${maven.home}/lib`. In general these are just Maven
libraries. For example instances of
[`MavenProject`](/ref/current/apidocs/org/apache/maven/project/MavenProject.html)
belong to this classloader.
+Contents of this classloader are configured in `${maven.home}/bin/m2.conf` and
typically contains `${maven.home}/lib/ext/*.jar` and `${maven.home}/lib/*.jar`.
+
You can add elements to this classloader by the means outlined in [Core
Extension](./guide-using-extensions.html). These are loaded through the same
classloader as `${maven.home}/lib` and hence are available to the Maven core
and all plugins for the current project (through the API Classloader, see next
paragraph). More information is available in [Core
Extension](./guide-using-extensions.html).
+## Core Extensions
+
+Core Extensions is a mechanism introduced in Maven 3.3.0 which allows
additional components to be loaded into Maven Core as part of a build session.
+
+Each core extension is loaded in a separate classloader and there is no
mechanism to share classes among core extensions. Core extension classloaders
use Maven Core classloader as the parent and have access to both exported and
internal Maven Core classes.
+
+A core extension can use a `META-INF/maven/extension.xml` descriptor to
declare packages and artifacts exported by the extension. If the descriptor is
not present, no packages or artifacts are exported, but the extension can still
contribute components to Maven Core extension points.
+
+Core extensions are configured in the `.mvn/extensions.xml` configuration file
at the project's top level:
+
+```xml
+<?xml version="1.0" encoding="UTF-8"?>
+<extensions>
+ <extension>
+ <groupId>...</groupId>
+ <artifactId>...</artifactId>
+ <version>...</version>
+ </extension>
+ <extension>...</extension>
+ ...
+</extensions>
+```
+
+Core extensions are loaded as part of Maven runtime startup and disposed of as
part of Maven runtime shutdown.
+
+## Maven Extensions Classloader
+
+The Maven Extensions classloader aggregates packages exported by all core
extension realms. It also loads additional classpath entries specified via the
`-Dmaven.ext.class.path` command line parameter.
+
+This classloader is created only when core extensions are configured for the
build. If created, it will be set as the "container realm" in the Plexus
container instance (replacing the Core Classloader in that role).
+
## API Classloader
-The API classloader is a filtered view of the Core Classloader, done by
exposing only the exported packages from all Core Extensions. The main API is
listed in [Maven Core Extensions
Reference](/ref/current/maven-core/core-extensions.html).
+The API classloader aggregates exported packages from both the Maven Core
classloader and any Maven Core Extensions classloaders. It does not include any
classes directly.
+
+This has been introduced with Maven 3.3.1
([MNG-5771](https://issues.apache.org/jira/browse/MNG-5771)). The main API is
listed in [Maven Core Extensions
Reference](/ref/current/maven-core/core-extensions.html).
Review Comment:
only deleting the part being mentioned and keeping
"(https://issues.apache.org/jira/browse/MNG-5771)" as it is.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]