本文整理匯總了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() );
}
}