Package org.codehaus.plexus

Examples of org.codehaus.plexus.DefaultPlexusContainer


    private static class ManualWagonProvider implements WagonProvider {

        public Wagon lookup(String roleHint) throws Exception {
            if ("http".equals(roleHint)) {
                PlexusContainer container= new DefaultPlexusContainer();
                Wagon httpWagon = (Wagon) container.lookup( org.apache.maven.wagon.Wagon.ROLE, "http" );
                container.dispose();
                return httpWagon;
            }
            return null;
        }
View Full Code Here


      if (container == null)
      {
         ClassLoader cl = Thread.currentThread().getContextClassLoader();
         try
         {
            container = new DefaultPlexusContainer();
            ConsoleLoggerManager loggerManager = new ConsoleLoggerManager();
            loggerManager.setThreshold("ERROR");
            getContainer().setLoggerManager(loggerManager);

            builder = getContainer().lookup(ProjectBuilder.class);
View Full Code Here

      if (container == null)
      {
         ClassLoader cl = Thread.currentThread().getContextClassLoader();
         try
         {
            container = new DefaultPlexusContainer();
            ConsoleLoggerManager loggerManager = new ConsoleLoggerManager();
            loggerManager.setThreshold("ERROR");
            getContainer().setLoggerManager(loggerManager);

            builder = getContainer().lookup(ProjectBuilder.class);
View Full Code Here

   @PostConstruct
   public void bootstrapMaven()
   {
      try
      {
         container = new DefaultPlexusContainer();
         ConsoleLoggerManager loggerManager = new ConsoleLoggerManager();
         loggerManager.setThreshold("ERROR");
         container.setLoggerManager(loggerManager);

         builder = container.lookup(ProjectBuilder.class);
View Full Code Here

    {
        try
        {
            if ( classWorld == null )
            {
                container = new DefaultPlexusContainer( "plexus", context, configuration, null );
            }
            else
            {
                container = new DefaultPlexusContainer( "plexus", context, configuration,
                                                        ClassWorldReverseAdapter.getInstance( classWorld ) );
            }

            embedderStarted = true;
        }
View Full Code Here

        if ( properties != null )
        {
            initializeContext();
        }

        container = new DefaultPlexusContainer( null, context, configurationUrl, null );

        embedderStarted = true;
    }
View Full Code Here

    }

    @Provides @Aether @Singleton
    public PlexusContainer aetherContainer() {
        try {
            return new DefaultPlexusContainer(
                new DefaultContainerConfiguration(),
                new AbstractModule() {
                    @Override
                    protected void configure() {
                        bind(VersionResolver.class).to(VersionResolverImpl.class);
View Full Code Here

        if ( cliRequest.classWorld == null )
        {
            cliRequest.classWorld = new ClassWorld( "plexus.core", Thread.currentThread().getContextClassLoader() );
        }

        DefaultPlexusContainer container = null;

        ContainerConfiguration cc = new DefaultContainerConfiguration()
            .setClassWorld( cliRequest.classWorld )
            .setRealm( setupContainerRealm( cliRequest ) )
            .setClassPathScanning( PlexusConstants.SCANNING_INDEX )
            .setAutoWiring( true )
            .setName( "maven" );

        container = new DefaultPlexusContainer( cc, new AbstractModule()
        {
            protected void configure()
            {
                bind( ILoggerFactory.class ).toInstance( slf4jLoggerFactory );
            }
        } );

        // NOTE: To avoid inconsistencies, we'll use the TCCL exclusively for lookups
        container.setLookupRealm( null );

        container.setLoggerManager( plexusLoggerManager );

        customizeContainer( container );

        container.getLoggerManager().setThresholds( cliRequest.request.getLoggingLevel() );

        Thread.currentThread().setContextClassLoader( container.getContainerRealm() );

        eventSpyDispatcher = container.lookup( EventSpyDispatcher.class );

        DefaultEventSpyContext eventSpyContext = new DefaultEventSpyContext();
        Map<String, Object> data = eventSpyContext.getData();
        data.put( "plexus", container );
        data.put( "workingDirectory", cliRequest.workingDirectory );
        data.put( "systemProperties", cliRequest.systemProperties );
        data.put( "userProperties", cliRequest.userProperties );
        data.put( "versionProperties", CLIReportingUtils.getBuildProperties() );
        eventSpyDispatcher.init( eventSpyContext );

        // refresh logger in case container got customized by spy
        slf4jLogger = slf4jLoggerFactory.getLogger( this.getClass().getName() );

        maven = container.lookup( Maven.class );

        executionRequestPopulator = container.lookup( MavenExecutionRequestPopulator.class );

        modelProcessor = createModelProcessor( container );

        settingsBuilder = container.lookup( SettingsBuilder.class );

        dispatcher = (DefaultSecDispatcher) container.lookup( SecDispatcher.class, "maven" );

        return container;
    }
View Full Code Here

    @Before
    public void setup()
        throws PlexusContainerException
    {
        container = new DefaultPlexusContainer();
        container.initialize();
        container.start();
    }
View Full Code Here

                     @Override
                     public DefaultPlexusContainer call() throws Exception
                     {
                        try
                        {
                           plexusContainer = new DefaultPlexusContainer();
                           ConsoleLoggerManager loggerManager = new ConsoleLoggerManager();
                           loggerManager.setThreshold("ERROR");
                           ((DefaultPlexusContainer) plexusContainer).setLoggerManager(loggerManager);
                           return (DefaultPlexusContainer) plexusContainer;
                        }
View Full Code Here

TOP

Related Classes of org.codehaus.plexus.DefaultPlexusContainer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.