• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java MavenExecutionResult类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.maven.execution.MavenExecutionResult的典型用法代码示例。如果您正苦于以下问题:Java MavenExecutionResult类的具体用法?Java MavenExecutionResult怎么用?Java MavenExecutionResult使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



MavenExecutionResult类属于org.apache.maven.execution包,在下文中一共展示了MavenExecutionResult类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:23,代码来源:MavenEmbedder.java


示例2: _handle

import org.apache.maven.execution.MavenExecutionResult; //导入依赖的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


示例3: newMavenSession

import org.apache.maven.execution.MavenExecutionResult; //导入依赖的package包/类
@Override
protected MavenSession newMavenSession(MavenProject project) {
	MavenExecutionResult result = new DefaultMavenExecutionResult();

	MavenSession session = new MavenSession(getContainer(),
			project.getProjectBuildingRequest().getRepositorySession(), currentMavenExecutionRequest, result);
	session.setCurrentProject(project);
	session.setProjects(Arrays.asList(project));

	try {
		LegacySupport legacySupport = this.lookup(LegacySupport.class);
		legacySupport.setSession(session);
	} catch (Exception e) {
		e.printStackTrace();
	}

	return session;
}
 
开发者ID:coastland,项目名称:gsp-dba-maven-plugin,代码行数:19,代码来源:AbstractDdlMojoTest.java


示例4: newSession

import org.apache.maven.execution.MavenExecutionResult; //导入依赖的package包/类
private MavenSession newSession(MavenProject project, File localrepo, Properties properties) throws Exception {
  MavenExecutionRequest request = new DefaultMavenExecutionRequest();
  MavenExecutionResult result = new DefaultMavenExecutionResult();
  DefaultRepositorySystemSession repoSession = MavenRepositorySystemUtils.newSession();
  LocalRepository localRepo = new LocalRepository(localrepo);
  repoSession.setLocalRepositoryManager(mojos.getContainer().lookup(LocalRepositoryManagerFactory.class, "simple").newInstance(repoSession, localRepo));
  MavenSession session = new MavenSession(mojos.getContainer(), repoSession, request, result);
  List<MavenProject> projects = new ArrayList<>();
  projects.add(project);
  for (String module : project.getModules()) {
    MavenProject moduleProject = readMavenProject(new File(project.getBasedir(), module), properties);
    moduleProject.setParent(project);
    projects.add(moduleProject);
  }

  session.setProjects(projects);
  return session;
}
 
开发者ID:takari,项目名称:takari-lifecycle,代码行数:19,代码来源:InstallDeployTest.java


示例5: getProjectClassPaths

import org.apache.maven.execution.MavenExecutionResult; //导入依赖的package包/类
public static List<String> getProjectClassPaths(String localPathRevision) throws Exception {
        MavenExecutionResult result = getResult(localPathRevision, Arrays.asList("dependency:resolve"), null);

//        List<Throwable> exceptions = result.getExceptions();
//        for (Throwable throwable : exceptions) {
//            throwable.printStackTrace();
//        }
        if (result.hasExceptions()) {
            throw new MavenException(result.getExceptions().toString());
        }

        Map<String, Artifact> artifactMap = result.getProject().getArtifactMap();
        List<String> classpath = new ArrayList<String>(artifactMap.size());
        for (String artifact : artifactMap.keySet()) {
            String path = artifactMap.get(artifact).getFile().getAbsolutePath();
//            System.out.println("artifact = " + path);
            classpath.add(path);
//            for (String string : artifact.getDependencyTrail()) {
//                System.out.println("                 " + string);
//            }
        }
        Collections.sort(classpath);
        return classpath;
    }
 
开发者ID:gems-uff,项目名称:oceano,代码行数:25,代码来源:MavenUtil.java


示例6: setResult

import org.apache.maven.execution.MavenExecutionResult; //导入依赖的package包/类
private void setResult(ProjectBuildingResult pbr, Map<File, MavenExecutionResult> results) {
    DefaultMavenExecutionResult r = new DefaultMavenExecutionResult();
    normalizePaths(pbr.getProject());
    r.setProject(pbr.getProject());
        r.setDependencyResolutionResult(pbr.getDependencyResolutionResult());
    results.put(pbr.getPomFile(), r);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:MavenEmbedder.java


示例7: testArtifactFixer

import org.apache.maven.execution.MavenExecutionResult; //导入依赖的package包/类
public void testArtifactFixer() throws Exception { // #197669
    File main = TestFileUtils.writeFile(new File(getWorkDir(), "main/pom.xml"), "<project xmlns='http://maven.apache.org/POM/4.0.0'><modelVersion>4.0.0</modelVersion>" +
        "<parent><groupId>g</groupId><artifactId>p</artifactId><version>0</version></parent>" +
        "<artifactId>m</artifactId>" +
        "<dependencies><dependency><groupId>g</groupId><artifactId>s</artifactId><version>0</version></dependency></dependencies>" +
        "</project>");
    final File parent = TestFileUtils.writeFile(new File(getWorkDir(), "parent/pom.xml"), "<project xmlns='http://maven.apache.org/POM/4.0.0'><modelVersion>4.0.0</modelVersion>" +
        "<groupId>g</groupId><artifactId>p</artifactId><version>0</version>" +
        "<packaging>pom</packaging>" +
        "<properties><k>v</k></properties>" +
        "</project>");
    final File sibling = TestFileUtils.writeFile(new File(getWorkDir(), "sib/pom.xml"), "<project xmlns='http://maven.apache.org/POM/4.0.0'><modelVersion>4.0.0</modelVersion>" +
        "<groupId>g</groupId><artifactId>s</artifactId><version>0</version>" +
        "<dependencies><dependency><groupId>g</groupId><artifactId>b</artifactId><version>0</version></dependency></dependencies>" +
        "</project>");
    final File binary = TestFileUtils.writeZipFile(new File(getWorkDir(), "b.jar"), "g/r:stuff");
    MockLookup.setInstances(new ArtifactFixer() {
        @Override public File resolve(org.eclipse.aether.artifact.Artifact artifact) {
            String id = artifact.getGroupId() + ':' + artifact.getArtifactId() + ':' + artifact.getExtension() + ':' + artifact.getVersion();
            if (id.equals("g:p:pom:0")) {
                return parent;
            } else if (id.equals("g:s:pom:0")) {
                return sibling;
            } else if (id.equals("g:b:jar:0")) {
                return binary;
            } else {
                return null;
            }
        }
    });
    MavenEmbedder e = EmbedderFactory.getProjectEmbedder();
    MavenExecutionRequest req = e.createMavenExecutionRequest();
    req.setPom(main);
    req.setOffline(true);
    MavenExecutionResult res = e.readProjectWithDependencies(req, true);
    assertEquals(Collections.emptyList(), res.getExceptions());
    MavenProject prj = res.getProject();
    assertEquals("v", prj.getProperties().getProperty("k"));
    assertEquals("[g:b:jar:0:compile, g:s:jar:0:compile]", new TreeSet<Artifact>(prj.getArtifacts()).toString());
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:41,代码来源:EmbedderFactoryTest.java


示例8: create

import org.apache.maven.execution.MavenExecutionResult; //导入依赖的package包/类
public ReactorContext create(MavenExecutionResult result, ProjectIndex index, ClassLoader classLoader, ReactorBuildStatus status, LifecycleModuleBuilder builder) {
    ReactorContext context;
    if (VERSION_3_0_0.compareTo(version) < 0) {
        throw new UnsupportedOperationException("ReactorContext is not supported in maven version:" + version);
    } else if (VERSION_3_3_0.compareTo(version) < 0) {
        context = create_3_2_x(result, index, classLoader, status);
    } else {
        context = create_3_3_x(result, index, classLoader, status, builder);
    }

    if (context == null) {
        throw new IllegalStateException("Unable to create ReactorContext");
    }
    return context;
}
 
开发者ID:sundrio,项目名称:sundrio,代码行数:16,代码来源:ReactorContextFactory.java


示例9: create_3_2_x

import org.apache.maven.execution.MavenExecutionResult; //导入依赖的package包/类
private static ReactorContext create_3_2_x(MavenExecutionResult result, ProjectIndex index, ClassLoader classLoader, ReactorBuildStatus status) {
    try {
        Constructor<ReactorContext> constructor = ReactorContext.class.getDeclaredConstructor(MavenExecutionResult.class, ProjectIndex.class, ClassLoader.class, ReactorBuildStatus.class);
        return constructor.newInstance(result, index, classLoader, status);
    } catch (NoSuchMethodException e) {
        return null;
    } catch (Throwable t) {
        throw new RuntimeException("Could not create ReactorContext.", t);
    }
}
 
开发者ID:sundrio,项目名称:sundrio,代码行数:11,代码来源:ReactorContextFactory.java


示例10: create_3_3_x

import org.apache.maven.execution.MavenExecutionResult; //导入依赖的package包/类
private static ReactorContext create_3_3_x(MavenExecutionResult result, ProjectIndex index, ClassLoader classLoader, ReactorBuildStatus status, LifecycleModuleBuilder builder) {
    try {
        Constructor<ReactorContext> constructor = (Constructor<ReactorContext>) ReactorContext.class.getDeclaredConstructors()[0];
        return constructor.newInstance(result, index, classLoader, status, Reflections.getMemento(builder));
    } catch (Throwable t) {
        throw new RuntimeException("Could not create ReactorContext.", t);
    }
}
 
开发者ID:sundrio,项目名称:sundrio,代码行数:9,代码来源:ReactorContextFactory.java


示例11: newMavenSession

import org.apache.maven.execution.MavenExecutionResult; //导入依赖的package包/类
protected MavenSession newMavenSession() {
    try {
        MavenExecutionRequest request = new DefaultMavenExecutionRequest();
        MavenExecutionResult result = new DefaultMavenExecutionResult();

        // populate sensible defaults, including repository basedir and remote repos
        MavenExecutionRequestPopulator populator;
        populator = getContainer().lookup( MavenExecutionRequestPopulator.class );
        populator.populateDefaults( request );

        // this is needed to allow java profiles to get resolved; i.e. avoid during project builds:
        // [ERROR] Failed to determine Java version for profile java-1.5-detected @ org.apache.commons:commons-parent:22, /Users/alex/.m2/repository/org/apache/commons/commons-parent/22/commons-parent-22.pom, line 909, column 14
        request.setSystemProperties( System.getProperties() );
        
        // and this is needed so that the repo session in the maven session 
        // has a repo manager, and it points at the local repo
        // (cf MavenRepositorySystemUtils.newSession() which is what is otherwise done)
        DefaultMaven maven = (DefaultMaven) getContainer().lookup( Maven.class );
        DefaultRepositorySystemSession repoSession =
            (DefaultRepositorySystemSession) maven.newRepositorySession( request );
        repoSession.setLocalRepositoryManager(
            new SimpleLocalRepositoryManagerFactory().newInstance(repoSession, 
                new LocalRepository( request.getLocalRepository().getBasedir() ) ));

        @SuppressWarnings("deprecation")
        MavenSession session = new MavenSession( getContainer(), 
            repoSession,
            request, result );
        return session;
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}
 
开发者ID:ahgittin,项目名称:license-audit-maven-plugin,代码行数:34,代码来源:BetterAbstractMojoTestCase.java


示例12: translatePom

import org.apache.maven.execution.MavenExecutionResult; //导入依赖的package包/类
private void translatePom(IFile input, IProgressMonitor monitor) throws CoreException {
  markerManager.deleteMarkers(input, TRANSLATION_PROBLEM_TYPE);

  IProject project = input.getProject();
  IFile pomXml = project.getFile(IMavenConstants.POM_FILE_NAME);
  IPath buildFolder;
  if (pomXml.exists()) {
   	IMavenProjectFacade facade = projectManager.create(pomXml, true, monitor);
   	MavenProject mavenProject = facade.getMavenProject(monitor);
   	buildFolder = facade.getProjectRelativePath(mavenProject.getBuild().getDirectory());
  } else {
  		//In case where pom.xml doesn't exist, fall back to default target folder
  		buildFolder = project.getFolder("target").getProjectRelativePath();
  }

  IPath polyglotFolder = buildFolder.append("polyglot");
  IFile output = project.getFolder(polyglotFolder).getFile(IMavenConstants.POM_FILE_NAME);
  MavenExecutionResult result = translate(pomXml, input, output, monitor);
  if (result.hasExceptions()) {
    addErrorMarkers(input, result.getExceptions());
    return;
  } 
  
  if (output.exists()) {
  	  try (InputStream content = output.getContents()) {
  		  if (pomXml.exists()) {
  			  pomXml.setContents(content, true, true, monitor);
  		  } else {
  			  pomXml.create(content, true, monitor);
  		  }
  		  if (!pomXml.isDerived()) {
  			  pomXml.setDerived(true, monitor);
  		  }
  	  } catch (IOException e) {
  		  throw new CoreException(new Status(IStatus.ERROR, PolyglotSupportActivator.PLUGIN_ID, "Unable to write to pom.xml", e));
 }
  }
}
 
开发者ID:jbosstools,项目名称:m2e-polyglot-poc,代码行数:39,代码来源:PomTranslatorJob.java


示例13: 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;
}
 
开发者ID:rvs-fluid-it,项目名称:mvn-fluid-cd,代码行数:10,代码来源:JenkinsDefaultMaven.java


示例14: ReactorContext

import org.apache.maven.execution.MavenExecutionResult; //导入依赖的package包/类
public ReactorContext( MavenExecutionResult result, ProjectIndex projectIndex,
                       ClassLoader originalContextClassLoader, ReactorBuildStatus reactorBuildStatus )
{
    this.result = result;
    this.projectIndex = projectIndex;
    this.originalContextClassLoader = originalContextClassLoader;
    this.reactorBuildStatus = reactorBuildStatus;
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:9,代码来源:ReactorContext.java


示例15: 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;
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:10,代码来源:DefaultMaven.java


示例16: testDependencyInjection

import org.apache.maven.execution.MavenExecutionResult; //导入依赖的package包/类
public void testDependencyInjection()
    throws Exception
{
    PlexusContainer container = getContainer();

    ComponentDescriptor<? extends AbstractMavenLifecycleParticipant> cd =
        new ComponentDescriptor<InjectDependencyLifecycleListener>( InjectDependencyLifecycleListener.class,
                                                                    container.getContainerRealm() );
    cd.setRoleClass( AbstractMavenLifecycleParticipant.class );
    container.addComponentDescriptor( cd );

    Maven maven = container.lookup( Maven.class );
    File pom = getProject( "lifecycle-listener-dependency-injection" );
    MavenExecutionRequest request = createMavenExecutionRequest( pom );
    request.setGoals( Arrays.asList( "validate" ) );
    MavenExecutionResult result = maven.execute( request );

    assertFalse( result.getExceptions().toString(), result.hasExceptions() );

    MavenProject project = result.getProject();
    
    assertEquals( "bar", project.getProperties().getProperty( "foo" ) );

    ArrayList<Artifact> artifacts = new ArrayList<Artifact>( project.getArtifacts() );

    assertEquals( 1, artifacts.size() );
    assertEquals( INJECTED_ARTIFACT_ID, artifacts.get( 0 ).getArtifactId() );
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:29,代码来源:MavenLifecycleParticipantTest.java


示例17: getExecutionResult

import org.apache.maven.execution.MavenExecutionResult; //导入依赖的package包/类
public static MavenExecutionResult getExecutionResult(MavenProject project) {
    return (MavenExecutionResult) project.getContextValue(CONTEXT_EXECUTION_RESULT);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:4,代码来源:MavenProjectCache.java


示例18: reportExceptions

import org.apache.maven.execution.MavenExecutionResult; //导入依赖的package包/类
@NbBundle.Messages({
    "TXT_Artifact_Resolution_problem=Artifact Resolution problem",
    "TXT_Artifact_Not_Found=Artifact Not Found",
    "TXT_Cannot_Load_Project=Unable to properly load project",
    "TXT_Cannot_read_model=Error reading project model",
    "TXT_NoMsg=Exception thrown while loading maven project at {0}. See messages.log for more information."
})
private Collection<ProjectProblem> reportExceptions(MavenExecutionResult res) {
    List<ProjectProblem> toRet = new ArrayList<ProjectProblem>();
    for (Throwable e : res.getExceptions()) {
        LOG.log(Level.FINE, "Error on loading project " + project.getProjectDirectory(), e);
        if (e instanceof ArtifactResolutionException) { // XXX when does this occur?
            toRet.add(ProjectProblem.createError(TXT_Artifact_Resolution_problem(), getDescriptionText(e)));
            problemReporter.addMissingArtifact(((ArtifactResolutionException) e).getArtifact());
            
        } else if (e instanceof ArtifactNotFoundException) { // XXX when does this occur?
            toRet.add(ProjectProblem.createError(TXT_Artifact_Not_Found(), getDescriptionText(e)));
            problemReporter.addMissingArtifact(((ArtifactNotFoundException) e).getArtifact());
        } else if (e instanceof ProjectBuildingException) {
            toRet.add(ProjectProblem.createError(TXT_Cannot_Load_Project(), getDescriptionText(e), new SanityBuildAction(project)));
            if (e.getCause() instanceof ModelBuildingException) {
                ModelBuildingException mbe = (ModelBuildingException) e.getCause();
                for (ModelProblem mp : mbe.getProblems()) {
                    LOG.log(Level.FINE, mp.toString(), mp.getException());
                    if (mp.getException() instanceof UnresolvableModelException) {
                        // Probably obsoleted by ProblemReporterImpl.checkParent, but just in case:
                        UnresolvableModelException ume = (UnresolvableModelException) mp.getException();
                        problemReporter.addMissingArtifact(EmbedderFactory.getProjectEmbedder().createProjectArtifact(ume.getGroupId(), ume.getArtifactId(), ume.getVersion()));
                    } else if (mp.getException() instanceof PluginResolutionException) {
                        Plugin plugin = ((PluginResolutionException) mp.getException()).getPlugin();
                        // XXX this is not actually accurate; should rather pick out the ArtifactResolutionException & ArtifactNotFoundException inside
                        problemReporter.addMissingArtifact(EmbedderFactory.getProjectEmbedder().createArtifact(plugin.getGroupId(), plugin.getArtifactId(), plugin.getVersion(), "jar"));
                    } else if (mp.getException() instanceof PluginManagerException) {
                        PluginManagerException ex = (PluginManagerException) mp.getException();                            
                        problemReporter.addMissingArtifact(EmbedderFactory.getProjectEmbedder().createArtifact(ex.getPluginGroupId(), ex.getPluginArtifactId(), ex.getPluginVersion(), "jar"));
                    }
                }
            }
        } else {
            String msg = e.getMessage();
            if(msg != null) {
                LOG.log(Level.INFO, "Exception thrown while loading maven project at " + project.getProjectDirectory(), e); //NOI18N
                toRet.add(ProjectProblem.createError(TXT_Cannot_read_model(), msg));
            } else {
                String path = project.getProjectDirectory().getPath();
                toRet.add(ProjectProblem.createError(TXT_Cannot_read_model(), TXT_NoMsg(path)));
                LOG.log(Level.WARNING, "Exception thrown while loading maven project at " + path, e); //NOI18N
            }
        }
    }
    return toRet;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:53,代码来源:MavenModelProblemsProvider.java


示例19: createBinaryDownloadTask

import org.apache.maven.execution.MavenExecutionResult; //导入依赖的package包/类
@Messages({
    "Progress_Download=Downloading Maven dependencies", 
    "# {0} - error message",
    "MSG_Failed=Failed to download - {0}", 
    "MSG_Done=Finished retrieving dependencies from remote repositories."})
private RequestProcessor.Task createBinaryDownloadTask(RequestProcessor rp) {
    return rp.create(new Runnable() {
        @Override
        public void run() {
                //#146171 try the hardest to avoid NPE for files/directories that
                // seemed to have been deleted while the task was scheduled.
                FileObject fo = project.getProjectDirectory();
                if (fo == null || !fo.isValid()) {
                    return;
                }
                fo = fo.getFileObject("pom.xml"); //NOI18N
                if (fo == null) {
                    return;
                }
                File pomFile = FileUtil.toFile(fo);
                if (pomFile == null) {
                    return;
                }
                MavenEmbedder online = EmbedderFactory.getOnlineEmbedder();
                AggregateProgressHandle hndl = AggregateProgressFactory.createHandle(Progress_Download(),
                        new ProgressContributor[] {
                            AggregateProgressFactory.createProgressContributor("zaloha") },  //NOI18N
                        ProgressTransferListener.cancellable(), null);

                boolean ok = true;
                try {
                    ProgressTransferListener.setAggregateHandle(hndl);
                    hndl.start();
                    MavenExecutionRequest req = online.createMavenExecutionRequest();
                    req.setPom(pomFile);
                    req.setTransferListener(ProgressTransferListener.activeListener());
                    MavenExecutionResult res = online.readProjectWithDependencies(req, false); //NOI18N
                    if (res.hasExceptions()) {
                        ok = false;
                        Exception ex = (Exception)res.getExceptions().get(0);
                        StatusDisplayer.getDefault().setStatusText(MSG_Failed(ex.getLocalizedMessage()));
                    }
                } catch (ThreadDeath d) { // download interrupted
                } catch (IllegalStateException x) {
                    if (x.getCause() instanceof ThreadDeath) {
                        // #197261: download interrupted
                    } else {
                        throw x;
                    }
                } catch (RuntimeException exc) {
                    //guard against exceptions that are not processed by the embedder
                    //#136184 NumberFormatException, #214152 InvalidArtifactRTException
                    StatusDisplayer.getDefault().setStatusText(MSG_Failed(exc.getLocalizedMessage()));
                } finally {
                    hndl.finish();
                    ProgressTransferListener.clearAggregateHandle();
                }
                if (ok) {
                    StatusDisplayer.getDefault().setStatusText(MSG_Done());
                }
                if (support.hasListeners(NbMavenProject.PROP_PROJECT)) {
                    NbMavenProject.fireMavenProjectReload(project);
                }
        }
    });
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:67,代码来源:NbMavenProject.java


示例20: execute

import org.apache.maven.execution.MavenExecutionResult; //导入依赖的package包/类
public MavenExecutionResult execute(MavenExecutionRequest req) {
    return maven.execute(req);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:4,代码来源:MavenEmbedder.java



注:本文中的org.apache.maven.execution.MavenExecutionResult类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java TabBar类代码示例发布时间:2022-05-22
下一篇:
Java Blitter类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap