You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Konrad Windszus (Jira)" <ji...@apache.org> on 2022/10/18 15:26:00 UTC

[jira] [Commented] (MNG-7574) Never expose Mojo classes via Core Classloader

    [ https://issues.apache.org/jira/browse/MNG-7574?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17619652#comment-17619652 ] 

Konrad Windszus commented on MNG-7574:
--------------------------------------

As there is no filtering support in https://codehaus-plexus.github.io/plexus-classworlds/apidocs/index.html nor in the underlying UrlClassLoader, I am thinking about implementing a custom {{URLStreamHandler}} (https://docs.oracle.com/javase/8/docs/api/java/net/URLStreamHandler.html) which provides filtering on top of https://docs.oracle.com/javase/8/docs/api/java/net/JarURLConnection.html.

Such a URL can be used also from Plexus Classworlds.

> Never expose Mojo classes via Core Classloader
> ----------------------------------------------
>
>                 Key: MNG-7574
>                 URL: https://issues.apache.org/jira/browse/MNG-7574
>             Project: Maven
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Konrad Windszus
>            Priority: Major
>
> Currently if a Maven plugin is loaded with {{<extensions>true</extensions}} all classes of the underlying artifact are exposed through the Maven Core Classloader (https://github.com/apache/maven/blob/415eaf31de407efcbf61166afd8cf4e86cdafe11/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java#L243 and https://github.com/apache/maven/blob/415eaf31de407efcbf61166afd8cf4e86cdafe11/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java#L345).
> At least the Mojo classes should IMHO be excluded otherwise they are exposed through both the plugin and core classloader for no reason (as the core classloader as parent always takes precedence).



--
This message was sent by Atlassian Jira
(v8.20.10#820010)