本文整理汇总了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;
}
示例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));
}
示例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() );
}
}