Skip to content

Commit

Permalink
FORGE-2186: Nuked DefaultPlexusContainer
Browse files Browse the repository at this point in the history
  • Loading branch information
gastaldi committed Jan 22, 2015
1 parent 434cdec commit 7e632d6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 945 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

import org.codehaus.plexus.ContainerConfiguration;
import org.codehaus.plexus.DefaultContainerConfiguration;
import org.codehaus.plexus.DefaultPlexusContainer;
import org.codehaus.plexus.logging.console.ConsoleLoggerManager;
import org.jboss.forge.addon.maven.projects.plexus.DefaultPlexusContainer;
import org.jboss.forge.furnace.container.cdi.events.Local;
import org.jboss.forge.furnace.event.PreShutdown;
import org.jboss.forge.furnace.util.ClassLoaders;
Expand All @@ -25,7 +25,7 @@
@Singleton
class PlexusContainer
{
private org.codehaus.plexus.PlexusContainer plexusContainer;
private org.codehaus.plexus.DefaultPlexusContainer plexusContainer;

public <T> T lookup(final Class<T> type)
{
Expand Down Expand Up @@ -85,10 +85,12 @@ public DefaultPlexusContainer call() throws Exception
{
ContainerConfiguration config = new DefaultContainerConfiguration().setAutoWiring(true);
plexusContainer = new DefaultPlexusContainer(config);
// NOTE: To avoid inconsistencies, we'll use the TCCL exclusively for lookups
plexusContainer.setLookupRealm(null);
ConsoleLoggerManager loggerManager = new ConsoleLoggerManager();
loggerManager.setThreshold("ERROR");
((DefaultPlexusContainer) plexusContainer).setLoggerManager(loggerManager);
return (DefaultPlexusContainer) plexusContainer;
plexusContainer.setLoggerManager(loggerManager);
return plexusContainer;
}
catch (Exception e)
{
Expand Down
Loading

0 comments on commit 7e632d6

Please sign in to comment.