Example usage for org.apache.maven.execution DefaultMavenExecutionResult addException

List of usage examples for org.apache.maven.execution DefaultMavenExecutionResult addException

Introduction

In this page you can find the example usage for org.apache.maven.execution DefaultMavenExecutionResult addException.

Prototype

public MavenExecutionResult addException(Throwable t) 

Source Link

Usage

From source file:org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.java

License:Open Source License

private MavenExecutionResult readProjectWithDependencies(IProjectRegistry state, final IFile pomFile,
        ResolverConfiguration resolverConfiguration, final IProgressMonitor monitor) {

    try {//from w ww .j  a v  a  2s .co  m
        return execute(state, pomFile, resolverConfiguration, new ICallable<MavenExecutionResult>() {
            public MavenExecutionResult call(IMavenExecutionContext context, IProgressMonitor monitor)
                    throws CoreException {
                ProjectBuildingRequest configuration = context.newProjectBuildingRequest();
                configuration.setResolveDependencies(true);
                return getMaven().readMavenProject(pomFile.getLocation().toFile(), configuration);
            }
        }, monitor);
    } catch (CoreException ex) {
        DefaultMavenExecutionResult result = new DefaultMavenExecutionResult();
        result.addException(ex);
        return result;
    }

}