Package org.codehaus.plexus.logging

Examples of org.codehaus.plexus.logging.Logger


    @Test
    public void testThreads() throws Exception
    {
        InvokerMavenExecutor executor = new InvokerMavenExecutor();
        Logger logger = mock( Logger.class );
        executor.enableLogging( logger );
       
        InvocationRequest req = new DefaultInvocationRequest();
        executor.setupRequest( req, null, "-T 3" );
        assertEquals( "3", req.getThreads() );
View Full Code Here


    @Test
    public void testGlobalSettings() throws Exception
    {
        InvokerMavenExecutor executor = new InvokerMavenExecutor();
        Logger logger = mock( Logger.class );
        executor.enableLogging( logger );
       
        InvocationRequest req = new DefaultInvocationRequest();
        executor.setupRequest( req, null, "-gs custom-settings.xml" );
        assertEquals( "custom-settings.xml", req.getGlobalSettingsFile().getPath() );
View Full Code Here

    @Test
    public void testThreads()
        throws Exception
    {
        Logger logger = mock( Logger.class );
        executor.enableLogging( logger );

        InvocationRequest req = new DefaultInvocationRequest();
        executor.setupRequest( req, null, "-T 3" );
        assertEquals( "3", req.getThreads() );
View Full Code Here

    @Test
    public void testGlobalSettings()
        throws Exception
    {
        Logger logger = mock( Logger.class );
        executor.enableLogging( logger );

        InvocationRequest req = new DefaultInvocationRequest();
        executor.setupRequest( req, null, "-gs custom-settings.xml" );
        assertEquals( "custom-settings.xml", req.getGlobalSettingsFile().getPath() );
View Full Code Here

        request = new DefaultMavenExecutionRequest( localRepository, settings, eventDispatcher,
                                                    commandLine.getArgList(), userDir.getPath(), profileManager,
                                                    executionProperties, userProperties, showErrors );

        // TODO [BP]: do we set one per mojo? where to do it?
        Logger logger = loggerManager.getLoggerForComponent( Mojo.ROLE );

        if ( logger != null )
        {
            request.addEventMonitor( new DefaultEventMonitor( logger ) );
        }
View Full Code Here

        if ( src.indexOf( "${" ) < 0 )
        {
            return src;
        }
       
        Logger logger = getLogger();

        String result = src;
        synchronized( this )
        {
           
            for ( Iterator it = valueSources.iterator(); it.hasNext(); )
            {
                ValueSource vs = (ValueSource) it.next();
                interpolator.addValueSource( vs );
            }
           
            for ( Iterator it = postProcessors.iterator(); it.hasNext(); )
            {
                InterpolationPostProcessor postProcessor = (InterpolationPostProcessor) it.next();
               
                interpolator.addPostProcessor( postProcessor );
            }

            try
            {
                try
                {
                    result = interpolator.interpolate( result, recursionInterceptor );
                }
                catch( InterpolationException e )
                {
                    throw new ModelInterpolationException( e.getMessage(), e );
                }

                if ( debug )
                {
                    List feedback = interpolator.getFeedback();
                    if ( feedback != null && !feedback.isEmpty() )
                    {
                        logger.debug( "Maven encountered the following problems during initial POM interpolation:" );

                        Object last = null;
                        for ( Iterator it = feedback.iterator(); it.hasNext(); )
                        {
                            Object next = it.next();

                            if ( next instanceof Throwable )
                            {
                                if ( last == null )
                                {
                                    logger.debug( "", ( (Throwable) next ) );
                                }
                                else
                                {
                                    logger.debug( String.valueOf( last ), ( (Throwable) next ) );
                                }
                            }
                            else
                            {
                                if ( last != null )
                                {
                                    logger.debug( String.valueOf( last ) );
                                }

                                last = next;
                            }
                        }

                        if ( last != null )
                        {
                            logger.debug( String.valueOf( last ) );
                        }
                    }
                }

                interpolator.clearFeedback();
View Full Code Here

        request = new DefaultMavenExecutionRequest( localRepository, settings, eventDispatcher,
                                                    commandLine.getArgList(), userDir.getPath(), profileManager,
                                                    executionProperties, userProperties, showErrors );

        // TODO [BP]: do we set one per mojo? where to do it?
        Logger logger = loggerManager.getLoggerForComponent( Mojo.ROLE );

        if ( logger != null )
        {
            request.addEventMonitor( new DefaultEventMonitor( logger ) );
        }
View Full Code Here

                }
            }

            if ( mojo instanceof Mojo )
            {
                Logger mojoLogger = loggerManager.getLoggerForComponent( mojoDescriptor.getImplementation() );
                ( (Mojo) mojo ).setLog( new DefaultLog( mojoLogger ) );
            }

            Xpp3Dom dom = mojoExecution.getConfiguration();
View Full Code Here

                }
            }

            if ( mojo instanceof Mojo )
            {
                Logger mojoLogger = loggerManager.getLoggerForComponent( mojoDescriptor.getImplementation() );
                ( (Mojo) mojo ).setLog( new DefaultLog( mojoLogger ) );
            }

            Xpp3Dom dom = mojoExecution.getConfiguration();
View Full Code Here

        if ( subCategory == null )
        {
            throw new IllegalStateException( "Logging category must be defined." );
        }

        Logger logger = this.logger.getChildLogger( subCategory );

        setupLogger( component, logger );
    }
View Full Code Here

TOP

Related Classes of org.codehaus.plexus.logging.Logger

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.