[MNG-7620] Rework how "exportedArtifacts" works
- Dominant language
- Java
- Stars
- 5.3k
- Forks
- 3.1k
- Avg merge
- 20h 42m
- Merged PRs (30d)
- 297
Description
**[Christoph Läubrich](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=laeubi)** opened **[MNG-7620](https://issues.apache.org/jira/browse/MNG-7620?redirect=false)** and commented
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
```java
Patterns of artifacts provided by maven core and exported via maven api realm
```
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.
---
No further details from [MNG-7620](https://issues.apache.org/jira/browse/MNG-7620?redirect=false)
Contributor guide
Research direction
Start with the referenced sections of maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java, especially lines 302-328 and 83-87. Trace how exported artifacts are documented and added to class realms, then clarify the intended shared-realm behavior and update the implementation and documentation accordingly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- build-system
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100