Package org.codehaus.plexus

Examples of org.codehaus.plexus.DefaultPlexusContainer


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

        DefaultPlexusContainer container = this.container;

        if ( container == null )
        {
            ContainerConfiguration cc = new DefaultContainerConfiguration()
                .setClassWorld( cliRequest.classWorld )
                .setName( "maven" );

            container = new DefaultPlexusContainer( cc );

            container.setLoggerManager( new MavenLoggerManager( logger ) );

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

            customizeContainer( container );

            if ( cliRequest.classWorld == classWorld )
            {
                this.container = container;
            }
        }

        maven = container.lookup( Maven.class );

        executionRequestPopulator = container.lookup( MavenExecutionRequestPopulator.class );

        modelProcessor = createModelProcessor( container );

        settingsBuilder = container.lookup( SettingsBuilder.class );

        dispatcher = (DefaultSecDispatcher) container.lookup( SecDispatcher.class );
    }
View Full Code Here


     */
    public void contextInitialized(ServletContextEvent servletContextEvent) {
        loaded = true;

        try {
            PlexusContainer pc = new DefaultPlexusContainer();
            PlexusUtils.configure(pc, "plexus-application.xml");
            ServletContext ctx = servletContextEvent.getServletContext();
            ctx.setAttribute(KEY, pc);

            pc.initialize();
            pc.start();
        } catch (Exception e) {
            LOG.error("Error initializing plexus container (scope: application)", e);
        }
    }
View Full Code Here

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

        DefaultPlexusContainer container = this.container;

        if ( container == null )
        {
            ContainerConfiguration cc = new DefaultContainerConfiguration()
                .setClassWorld( cliRequest.classWorld )
                .setName( "maven" );

            container = new DefaultPlexusContainer( cc );

            container.setLoggerManager( new MavenLoggerManager( logger ) );

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

            customizeContainer( container );

            if ( cliRequest.classWorld == classWorld )
            {
                this.container = container;
            }
        }

        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" );
    }
View Full Code Here

        Map keys = new HashMap();

        PlexusContainer pc;
        try
        {
            pc = new DefaultPlexusContainer( "default", keys, "META-INF/plexus/application.xml",
                                             new ClassWorld( "plexus.core", getClass().getClassLoader() ) );

            context.setAttribute( PlexusConstants.PLEXUS_KEY, pc );
        }
        catch ( PlexusContainerException e )
View Full Code Here

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

        ContainerConfiguration cc =
            new DefaultContainerConfiguration().setClassWorld( classWorld ).setName( "embedder" );
        try
        {
            container = new DefaultPlexusContainer( cc );
        }
        catch ( PlexusContainerException e )
        {
            e.printStackTrace();
            fail( "Failed to create plexus container." );
View Full Code Here

                    bind( MavenProject.class ).toProvider( MojoExecutionScope.<MavenProject> seededKeyProvider() ).in( executionScope );
                    bind( MojoExecution.class ).toProvider( MojoExecutionScope.<MojoExecution> seededKeyProvider() ).in( executionScope );
                }
            } );
            addGuiceModules( modules );
            container = new DefaultPlexusContainer( cc, modules.toArray( new Module[modules.size()] ) );
        }
        catch ( PlexusContainerException e )
        {
            e.printStackTrace();
            fail( "Failed to create plexus container." );
View Full Code Here

    @BeforeClass
    public static void bootstrap()
        throws PlexusContainerException, ComponentLookupException, IOException
    {
        container = new DefaultPlexusContainer();
        container.initialize();
        container.start();
       
        artifactResolver = (ArtifactResolver) container.lookup( ArtifactResolver.class.getName() );
        metadataSource = (ArtifactMetadataSource) container.lookup( ArtifactMetadataSource.class.getName(), "maven" );
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

        ClassRealm classRealm = new ClassRealm( classWorld, "maven", Thread.currentThread().getContextClassLoader() );
        conf.setRealm( classRealm );

        conf.setClassWorld( classWorld );

        plexusContainer = new DefaultPlexusContainer( conf );
    }
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.