[jira] [Commented] (MNG-7620) Rework how "exportedArtifacts" works

2022-12-07 Thread Romain Manni-Bucau (Jira)


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

Romain Manni-Bucau commented on MNG-7620:
-

Today exports are quite wrong from a design perspective and we leak way too 
much so v4 will clean up things and using extensions you are able to contribute 
artifacts in the same realm which will make the runtime more consistent and 
less error prone.

Using another classrealm intermediate can be not bad but then you will not be 
in core which is likely desired sometimes so let's keep it simple and enrich 
ext classrealm only and expose or not the libs to mojos.

> Rework how "exportedArtifacts" works
> 
>
> Key: MNG-7620
> URL: https://issues.apache.org/jira/browse/MNG-7620
> Project: Maven
>  Issue Type: Improvement
>Reporter: Christoph Läubrich
>Priority: Major
>
> Recently there was a discussion about "exportedArtifacts" and how the work 
> here are the relevant code path:
> https://github.com/apache/maven/blob/master/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java#L302-L328
> https://github.com/apache/maven/blob/master/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java#L83-L87
> First the documentation is a bit misleading, as it says
> {code:java}
> Patterns of artifacts provided by maven core and exported via maven api realm
> {code}
> from some experiments, it seems that any core or project extension can also 
> define "exported" artifacts.
> Second is, that this simply adds the URL of an exported artifact and thus 
> always the same *jar* is used to load the class, but still different 
> classrealms can load the class.
> What came into my mind is that it actually should have an own realm where 
> such exported artifacts are loaded and this realm is then imported instead of 
> the URL.



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


[jira] [Commented] (MNG-7620) Rework how "exportedArtifacts" works

2022-12-07 Thread Jira


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

Christoph Läubrich commented on MNG-7620:
-

An this is about how extensions.xml so I don't get what you want to say with 
"Guess with the new v4 api" thing ...


> Rework how "exportedArtifacts" works
> 
>
> Key: MNG-7620
> URL: https://issues.apache.org/jira/browse/MNG-7620
> Project: Maven
>  Issue Type: Improvement
>Reporter: Christoph Läubrich
>Priority: Major
>
> Recently there was a discussion about "exportedArtifacts" and how the work 
> here are the relevant code path:
> https://github.com/apache/maven/blob/master/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java#L302-L328
> https://github.com/apache/maven/blob/master/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java#L83-L87
> First the documentation is a bit misleading, as it says
> {code:java}
> Patterns of artifacts provided by maven core and exported via maven api realm
> {code}
> from some experiments, it seems that any core or project extension can also 
> define "exported" artifacts.
> Second is, that this simply adds the URL of an exported artifact and thus 
> always the same *jar* is used to load the class, but still different 
> classrealms can load the class.
> What came into my mind is that it actually should have an own realm where 
> such exported artifacts are loaded and this realm is then imported instead of 
> the URL.



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


[jira] [Commented] (MNG-7620) Rework how "exportedArtifacts" works

2022-12-07 Thread Romain Manni-Bucau (Jira)


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

Romain Manni-Bucau commented on MNG-7620:
-

extensions.xml enables that or you enhance maven core class realm "factory" if 
you prefer (depends if you want it to be static or dynamic I'd say).

only pre-requisite: load the extension early enough, ie not part of the 
project/build itself but we can't really help that until we enable some reload 
mecanism which would break more than it would help for a build system IMHO.

> Rework how "exportedArtifacts" works
> 
>
> Key: MNG-7620
> URL: https://issues.apache.org/jira/browse/MNG-7620
> Project: Maven
>  Issue Type: Improvement
>Reporter: Christoph Läubrich
>Priority: Major
>
> Recently there was a discussion about "exportedArtifacts" and how the work 
> here are the relevant code path:
> https://github.com/apache/maven/blob/master/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java#L302-L328
> https://github.com/apache/maven/blob/master/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java#L83-L87
> First the documentation is a bit misleading, as it says
> {code:java}
> Patterns of artifacts provided by maven core and exported via maven api realm
> {code}
> from some experiments, it seems that any core or project extension can also 
> define "exported" artifacts.
> Second is, that this simply adds the URL of an exported artifact and thus 
> always the same *jar* is used to load the class, but still different 
> classrealms can load the class.
> What came into my mind is that it actually should have an own realm where 
> such exported artifacts are loaded and this realm is then imported instead of 
> the URL.



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


[jira] [Commented] (MNG-7620) Rework how "exportedArtifacts" works

2022-12-07 Thread Jira


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

Christoph Läubrich commented on MNG-7620:
-

But how does an extension "exports" things then (not part of maven ap/impl).

> Rework how "exportedArtifacts" works
> 
>
> Key: MNG-7620
> URL: https://issues.apache.org/jira/browse/MNG-7620
> Project: Maven
>  Issue Type: Improvement
>Reporter: Christoph Läubrich
>Priority: Major
>
> Recently there was a discussion about "exportedArtifacts" and how the work 
> here are the relevant code path:
> https://github.com/apache/maven/blob/master/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java#L302-L328
> https://github.com/apache/maven/blob/master/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java#L83-L87
> First the documentation is a bit misleading, as it says
> {code:java}
> Patterns of artifacts provided by maven core and exported via maven api realm
> {code}
> from some experiments, it seems that any core or project extension can also 
> define "exported" artifacts.
> Second is, that this simply adds the URL of an exported artifact and thus 
> always the same *jar* is used to load the class, but still different 
> classrealms can load the class.
> What came into my mind is that it actually should have an own realm where 
> such exported artifacts are loaded and this realm is then imported instead of 
> the URL.



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


[jira] [Commented] (MNG-7620) Rework how "exportedArtifacts" works

2022-12-07 Thread Romain Manni-Bucau (Jira)


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

Romain Manni-Bucau commented on MNG-7620:
-

Guess with the new v4 api it will mainly be a matter of taking what is exported 
from maven-core (v4 api impl) + optionally added by extensions and be it.

 

Side note: for v3 plugin we must keep the legacy behavior of exporting or not 
based on a predefined list (+ext).

> Rework how "exportedArtifacts" works
> 
>
> Key: MNG-7620
> URL: https://issues.apache.org/jira/browse/MNG-7620
> Project: Maven
>  Issue Type: Improvement
>Reporter: Christoph Läubrich
>Priority: Major
>
> Recently there was a discussion about "exportedArtifacts" and how the work 
> here are the relevant code path:
> https://github.com/apache/maven/blob/master/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java#L302-L328
> https://github.com/apache/maven/blob/master/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java#L83-L87
> First the documentation is a bit misleading, as it says
> {code:java}
> Patterns of artifacts provided by maven core and exported via maven api realm
> {code}
> from some experiments, it seems that any core or project extension can also 
> define "exported" artifacts.
> Second is, that this simply adds the URL of an exported artifact and thus 
> always the same *jar* is used to load the class, but still different 
> classrealms can load the class.
> What came into my mind is that it actually should have an own realm where 
> such exported artifacts are loaded and this realm is then imported instead of 
> the URL.



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