Maven Invoker插件日志到控制台(System.out)?

时间:2013-01-30 22:34:08

标签: maven maven-3 maven-plugin

以某种方式可以配置Maven Invoker Plugin来记录System.out而不是build.log文件吗?

2 个答案:

答案 0 :(得分:1)

maven-invoker-plugin有两个参数noLogstreamLog你应该检查其中一个是否满足你的要求。我认为streamLog应该是正确的方向。

答案 1 :(得分:0)

没有。他们创建文件记录器并广泛使用它:

private FileLogger setupLogger( File basedir )
    throws MojoExecutionException
{
    FileLogger logger = null;

    if ( !noLog )
    {
        File outputLog = new File( basedir, "build.log" );
        try
        {
            if ( streamLogs )
            {
                logger = new FileLogger( outputLog, getLog() );
            }
            else
            {
                logger = new FileLogger( outputLog );
            }

            getLog().debug( "build log initialized in: " + outputLog );
        }
        catch ( IOException e )
        {
            throw new MojoExecutionException( "Error initializing build logfile in: " + outputLog, e );
        }
    }

    return logger;
}