本文整理汇总了Java中org.apache.maven.execution.MavenExecutionResult.addException方法的典型用法代码示例。如果您正苦于以下问题:Java MavenExecutionResult.addException方法的具体用法?Java MavenExecutionResult.addException怎么用?Java MavenExecutionResult.addException使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.maven.execution.MavenExecutionResult
的用法示例。
在下文中一共展示了MavenExecutionResult.addException方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: readProjectWithDependencies
import org.apache.maven.execution.MavenExecutionResult; //导入方法依赖的package包/类
public MavenExecutionResult readProjectWithDependencies(MavenExecutionRequest req, boolean useWorkspaceResolution) {
if (useWorkspaceResolution) {
req.setWorkspaceReader(new NbWorkspaceReader());
}
File pomFile = req.getPom();
MavenExecutionResult result = new DefaultMavenExecutionResult();
try {
ProjectBuildingRequest configuration = req.getProjectBuildingRequest();
configuration.setValidationLevel(ModelBuildingRequest.VALIDATION_LEVEL_MINIMAL);
configuration.setResolveDependencies(true);
configuration.setRepositorySession(maven.newRepositorySession(req));
ProjectBuildingResult projectBuildingResult = projectBuilder.build(pomFile, configuration);
result.setProject(projectBuildingResult.getProject());
result.setDependencyResolutionResult(projectBuildingResult.getDependencyResolutionResult());
} catch (ProjectBuildingException ex) {
//don't add the exception here. this should come out as a build marker, not fill
//the error logs with msgs
return result.addException(ex);
}
normalizePaths(result.getProject());
return result;
}
示例2: addExceptionToResult
import org.apache.maven.execution.MavenExecutionResult; //导入方法依赖的package包/类
private MavenExecutionResult addExceptionToResult( MavenExecutionResult result, Throwable e )
{
if ( !result.getExceptions().contains( e ) )
{
result.addException( e );
}
return result;
}
示例3: processResult
import org.apache.maven.execution.MavenExecutionResult; //导入方法依赖的package包/类
private MavenExecutionResult processResult( MavenExecutionResult result, Throwable e )
{
if ( !result.getExceptions().contains( e ) )
{
result.addException( e );
}
return result;
}