當前位置: 首頁>>代碼示例>>Java>>正文


Java BuildSummary類代碼示例

本文整理匯總了Java中org.apache.maven.execution.BuildSummary的典型用法代碼示例。如果您正苦於以下問題:Java BuildSummary類的具體用法?Java BuildSummary怎麽用?Java BuildSummary使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


BuildSummary類屬於org.apache.maven.execution包,在下文中一共展示了BuildSummary類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: _handle

import org.apache.maven.execution.BuildSummary; //導入依賴的package包/類
@Override
protected boolean _handle(MavenExecutionResult result) {
    Xpp3Dom root = new Xpp3Dom("MavenExecutionResult");
    root.setAttribute("class", result.getClass().getName());

    for (MavenProject project : result.getTopologicallySortedProjects()) {
        BuildSummary summary = result.getBuildSummary(project);
        if (summary == null) {
            Xpp3Dom comment = new Xpp3Dom("comment");
            comment.setValue("No build summary found for maven project: " + project);
            root.addChild(comment);
        } else {
            Xpp3Dom buildSummary = newElement("buildSummary", project);
            root.addChild(buildSummary);
            buildSummary.setAttribute("class", summary.getClass().getName());
            buildSummary.setAttribute("time", Long.toString(summary.getTime()));
        }
    }
    for(Throwable throwable: result.getExceptions()) {
        root.addChild(newElement("exception", throwable));
    }
    reporter.print(root);
    return true;
}
 
開發者ID:jenkinsci,項目名稱:pipeline-maven-plugin,代碼行數:25,代碼來源:MavenExecutionResultHandler.java

示例2: logCompleted

import org.apache.maven.execution.BuildSummary; //導入依賴的package包/類
private void logCompleted(MavenProject project) {
  BuildSummary buildSummary = rootSession.getResult().getBuildSummary(project);
  String message = "SKIPPED";
  if (buildSummary instanceof BuildSuccess) {
    message = "SUCCESS";
  } else if (buildSummary instanceof BuildFailure) {
    message = "FAILURE";
  } else if (buildSummary != null) {
    logger.warn("Unexpected project build summary class {}", buildSummary.getClass());
    message = "UNKNOWN";
  }
  logger.info("{} build of project {}", message, projectGA(project));
}
 
開發者ID:takari,項目名稱:takari-smart-builder,代碼行數:14,代碼來源:SmartBuilderImpl.java

示例3: logReactorSummary

import org.apache.maven.execution.BuildSummary; //導入依賴的package包/類
private void logReactorSummary( MavenSession session )
{
    logger.info( chars( '-', LINE_LENGTH ) );

    logger.info( "Reactor Summary:" );

    logger.info( "" );

    MavenExecutionResult result = session.getResult();

    for ( MavenProject project : session.getProjects() )
    {
        StringBuilder buffer = new StringBuilder( 128 );

        buffer.append( project.getName() );

        buffer.append( ' ' );
        while ( buffer.length() < LINE_LENGTH - 21 )
        {
            buffer.append( '.' );
        }
        buffer.append( ' ' );

        BuildSummary buildSummary = result.getBuildSummary( project );

        if ( buildSummary == null )
        {
            buffer.append( "SKIPPED" );
        }
        else if ( buildSummary instanceof BuildSuccess )
        {
            buffer.append( "SUCCESS [" );
            buffer.append( getFormattedTime( buildSummary.getTime() ) );
            buffer.append( "]" );
        }
        else if ( buildSummary instanceof BuildFailure )
        {
            buffer.append( "FAILURE [" );
            buffer.append( getFormattedTime( buildSummary.getTime() ) );
            buffer.append( "]" );
        }

        logger.info( buffer.toString() );
    }
}
 
開發者ID:gems-uff,項目名稱:oceano,代碼行數:46,代碼來源:ExecutionEventLogger.java


注:本文中的org.apache.maven.execution.BuildSummary類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。