This is an automated email from the ASF dual-hosted git repository.

skygo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
     new a39a723  [NETBEANS-4071] Fix plexus class setup for maven embedder
     new 67505fb  Merge pull request #2087 from matthiasblaesing/NETBEANS-4071
a39a723 is described below

commit a39a723fc49452a9b8dfb93833654a1f05eb7558
Author: Matthias Bläsing <[email protected]>
AuthorDate: Sat Apr 18 10:20:10 2020 +0200

    [NETBEANS-4071] Fix plexus class setup for maven embedder
    
    Updated maven embedder and indexer changed jar structure and in turn
    the setup of the classrealm needs to be updated to match.
---
 .../maven/indexer/NexusRepositoryIndexerImpl.java  | 23 +++++++++-------------
 1 file changed, 9 insertions(+), 14 deletions(-)

diff --git 
a/java/maven.indexer/src/org/netbeans/modules/maven/indexer/NexusRepositoryIndexerImpl.java
 
b/java/maven.indexer/src/org/netbeans/modules/maven/indexer/NexusRepositoryIndexerImpl.java
index 68bfbda..5a93cda 100644
--- 
a/java/maven.indexer/src/org/netbeans/modules/maven/indexer/NexusRepositoryIndexerImpl.java
+++ 
b/java/maven.indexer/src/org/netbeans/modules/maven/indexer/NexusRepositoryIndexerImpl.java
@@ -225,21 +225,16 @@ public class NexusRepositoryIndexerImpl implements 
RepositoryIndexerImplementati
         if (!inited) {
             try {
                 ContainerConfiguration config = new 
DefaultContainerConfiguration();
-                   //#154755 - start
-                   ClassWorld world = new ClassWorld();
-                   ClassRealm embedderRealm = world.newRealm("maven.embedder", 
MavenEmbedder.class.getClassLoader()); //NOI18N
+                //#154755 - start
                 ClassLoader indexerLoader = 
NexusRepositoryIndexerImpl.class.getClassLoader();
-                   ClassRealm indexerRealm = world.newRealm("maven.indexer", 
indexerLoader); //NOI18N
-                   ClassRealm plexusRealm = world.newRealm("plexus.core", 
indexerLoader); //NOI18N
-                   //need to import META-INF/plexus stuff, otherwise the items 
in META-INF will not be loaded,
-                   // and the Dependency Injection won't work.
-                   plexusRealm.importFrom(embedderRealm.getId(), 
"META-INF/plexus"); //NOI18N
-                   plexusRealm.importFrom(embedderRealm.getId(), 
"META-INF/maven"); //NOI18N
-                   plexusRealm.importFrom(indexerRealm.getId(), 
"META-INF/plexus"); //NOI18N
-                   plexusRealm.importFrom(indexerRealm.getId(), 
"META-INF/maven"); //NOI18N
-                   config.setClassWorld(world);
-                    config.setClassPathScanning( 
PlexusConstants.SCANNING_INDEX );
-                   //#154755 - end
+                ClassWorld classWorld = new ClassWorld();
+                ClassRealm plexusRealm = classWorld.newRealm("plexus.core", 
EmbedderFactory.class.getClassLoader()); //NOI18N
+                plexusRealm.importFrom(indexerLoader, "META-INF/sisu"); 
//NOI18N
+                plexusRealm.importFrom(indexerLoader, 
"org.apache.maven.index"); //NOI18N
+                plexusRealm.importFrom(indexerLoader, 
"org.netbeans.modules.maven.indexer"); //NOI18N
+                config.setClassWorld(classWorld);
+                config.setClassPathScanning( PlexusConstants.SCANNING_INDEX );
+                //#154755 - end
                 embedder = new DefaultPlexusContainer(config);
 
                 ComponentDescriptor<ArtifactContextProducer> desc = new 
ComponentDescriptor<ArtifactContextProducer>();


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to