当前位置: 首页>>代码示例>>Java>>正文


Java MavenProcessCanceledException类代码示例

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


MavenProcessCanceledException类属于org.jetbrains.idea.maven.utils包,在下文中一共展示了MavenProcessCanceledException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: resolve

import org.jetbrains.idea.maven.utils.MavenProcessCanceledException; //导入依赖的package包/类
@Override
public void resolve(Project project,
                    MavenProject mavenProject,
                    NativeMavenProjectHolder nativeMavenProject,
                    MavenEmbedderWrapper embedder,
                    ResolveContext context) throws MavenProcessCanceledException {
  String version = getVersion(mavenProject);
  if (version != null) {
    List<MavenRemoteRepository> repos = mavenProject.getRemoteRepositories();
    MavenArtifactInfo artifactInfo = new MavenArtifactInfo("com.google.appengine", "appengine-java-sdk", version, "zip", null);
    MavenArtifact artifact = embedder.resolve(artifactInfo, repos);
    File file = artifact.getFile();
    File unpackedSdkPath = new File(file.getParentFile(), "appengine-java-sdk");
    if (file.exists() && !AppEngineSdkUtil.checkPath(FileUtil.toSystemIndependentName(unpackedSdkPath.getAbsolutePath())).isOk()) {
      try {
        ZipUtil.extract(file, unpackedSdkPath, null, false);
      }
      catch (IOException e) {
        MavenLog.LOG.warn("cannot unpack AppEngine SDK", e);
      }
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:AppEngineFacetImporter.java

示例2: perform

import org.jetbrains.idea.maven.utils.MavenProcessCanceledException; //导入依赖的package包/类
public void perform(final Project project, MavenEmbeddersManager embeddersManager, MavenConsole console, MavenProgressIndicator indicator)
  throws MavenProcessCanceledException {
  MavenArtifactDownloader.DownloadResult result =
    myTree.downloadSourcesAndJavadocs(project, myProjects, myArtifacts, myDownloadSources, myDownloadDocs, embeddersManager, console, indicator);
  if (myCallbackResult != null) myCallbackResult.setDone(result);

  // todo: hack to update all file pointers.
  MavenUtil.invokeLater(project, new Runnable() {
    public void run() {
      AccessToken accessToken = WriteAction.start();
      try {
        ProjectRootManagerEx.getInstanceEx(project).makeRootsChange(EmptyRunnable.getInstance(), false, true);
      }
      finally {
        accessToken.finish();
      }
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:MavenProjectsProcessorArtifactsDownloadingTask.java

示例3: generateSources

import org.jetbrains.idea.maven.utils.MavenProcessCanceledException; //导入依赖的package包/类
@Nullable
public static MavenProjectReaderResult generateSources(MavenEmbedderWrapper embedder,
                                                       MavenImportingSettings importingSettings,
                                                       VirtualFile file,
                                                       MavenExplicitProfiles profiles,
                                                       MavenConsole console) throws MavenProcessCanceledException {
  try {
    List<String> goals = Collections.singletonList(importingSettings.getUpdateFoldersOnImportPhase());
    MavenServerExecutionResult result = embedder.execute(file, profiles.getEnabledProfiles(), profiles.getDisabledProfiles(), goals);
    MavenServerExecutionResult.ProjectData projectData = result.projectData;
    if (projectData == null) return null;

    return new MavenProjectReaderResult(projectData.mavenModel,
                                        projectData.mavenModelMap,
                                        new MavenExplicitProfiles(projectData.activatedProfiles, profiles.getDisabledProfiles()),
                                        projectData.nativeMavenProject,
                                        result.problems,
                                        result.unresolvedArtifacts);
  }
  catch (Throwable e) {
    console.printException(e);
    MavenLog.LOG.warn(e);
    return null;
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:MavenProjectReader.java

示例4: updateIndex

import org.jetbrains.idea.maven.utils.MavenProcessCanceledException; //导入依赖的package包/类
public void updateIndex(final int localId,
                        final MavenGeneralSettings settings,
                        final MavenProgressIndicator indicator) throws MavenProcessCanceledException,
                                                                       MavenServerIndexerException {
  perform(new IndexRetriableCancelable<Object>() {
    @Override
    public Object execute() throws RemoteException, MavenServerIndexerException, MavenServerProcessCanceledException {
      MavenServerProgressIndicator indicatorWrapper = MavenServerManager.wrapAndExport(indicator);
      try {
        getOrCreateWrappee().updateIndex(getRemoteId(localId), MavenServerManager.convertSettings(settings), indicatorWrapper);
      }
      finally {
        UnicastRemoteObject.unexportObject(indicatorWrapper, true);
      }
      return null;
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:MavenIndexerWrapper.java

示例5: execute

import org.jetbrains.idea.maven.utils.MavenProcessCanceledException; //导入依赖的package包/类
@NotNull
public MavenServerExecutionResult execute(@NotNull final VirtualFile file,
                                          @NotNull final Collection<String> activeProfiles,
                                          @NotNull final Collection<String> inactiveProfiles,
                                          @NotNull final List<String> goals,
                                          @NotNull final List<String> selectedProjects,
                                          final boolean alsoMake,
                                          final boolean alsoMakeDependents) throws MavenProcessCanceledException {
  return perform(new RetriableCancelable<MavenServerExecutionResult>() {
    @Override
    public MavenServerExecutionResult execute() throws RemoteException, MavenServerProcessCanceledException {
      return getOrCreateWrappee()
        .execute(new File(file.getPath()), activeProfiles, inactiveProfiles, goals, selectedProjects, alsoMake, alsoMakeDependents);
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:MavenEmbedderWrapper.java

示例6: generateSources

import org.jetbrains.idea.maven.utils.MavenProcessCanceledException; //导入依赖的package包/类
@Nullable
public static MavenProjectReaderResult generateSources(MavenEmbedderWrapper embedder,
                                                       MavenImportingSettings importingSettings,
                                                       VirtualFile file,
                                                       Collection<String> profiles,
                                                       MavenConsole console) throws MavenProcessCanceledException {
  try {
    List<String> goals = Collections.singletonList(importingSettings.getUpdateFoldersOnImportPhase());
    MavenServerExecutionResult result = embedder.execute(file, profiles, goals);
    if (result.projectData == null) return null;

    return new MavenProjectReaderResult(result.projectData.mavenModel,
                                        result.projectData.mavenModelMap,
                                        result.projectData.activatedProfiles,
                                        result.projectData.nativeMavenProject,
                                        result.problems,
                                        result.unresolvedArtifacts);
  }
  catch (Throwable e) {
    console.printException(e);
    MavenLog.LOG.warn(e);
    return null;
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:25,代码来源:MavenProjectReader.java

示例7: resolve

import org.jetbrains.idea.maven.utils.MavenProcessCanceledException; //导入依赖的package包/类
@Override
public void resolve(final Project project,
                    MavenProject mavenProject,
                    NativeMavenProjectHolder nativeMavenProject,
                    MavenEmbedderWrapper embedder,
                    ResolveContext context)
  throws MavenProcessCanceledException {
  final AndroidExternalApklibDependenciesManager adm =
    AndroidExternalApklibDependenciesManager.getInstance(project);

  for (MavenArtifact depArtifact : mavenProject.getDependencies()) {
    final MavenProjectsManager mavenProjectsManager = MavenProjectsManager.getInstance(project);

    if (AndroidMavenUtil.APKLIB_DEPENDENCY_AND_PACKAGING_TYPE.equals(depArtifact.getType()) &&
        mavenProjectsManager.findProject(depArtifact) == null &&
        MavenConstants.SCOPE_COMPILE.equals(depArtifact.getScope())) {

      Set<MavenId> resolvedArtifacts = context.getUserData(RESOLVED_APKLIB_ARTIFACTS_KEY);

      if (resolvedArtifacts == null) {
        resolvedArtifacts = new HashSet<MavenId>();
        context.putUserData(RESOLVED_APKLIB_ARTIFACTS_KEY, resolvedArtifacts);
      }
      if (resolvedArtifacts.add(depArtifact.getMavenId())) {
        doResolveApklibArtifact(project, depArtifact, embedder, mavenProjectsManager, mavenProject.getName(), adm, context);
      }
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:30,代码来源:AndroidFacetImporterBase.java

示例8: perform

import org.jetbrains.idea.maven.utils.MavenProcessCanceledException; //导入依赖的package包/类
public void perform(Project project,
                    MavenEmbeddersManager embeddersManager,
                    MavenConsole console,
                    MavenProgressIndicator indicator) throws MavenProcessCanceledException {
  if (myFilesToUpdate == null) {
    myTree.updateAll(myForce, mySettings, indicator);
  }
  else {
    myTree.delete(myFilesToDelete, mySettings, indicator);
    myTree.update(myFilesToUpdate, myForce, mySettings, indicator);
  }

  if (myOnCompletion != null) myOnCompletion.run();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:MavenProjectsProcessorReadingTask.java

示例9: download

import org.jetbrains.idea.maven.utils.MavenProcessCanceledException; //导入依赖的package包/类
public static DownloadResult download(@NotNull Project project,
                                      MavenProjectsTree projectsTree,
                                      Collection<MavenProject> mavenProjects,
                                      @Nullable Collection<MavenArtifact> artifacts,
                                      boolean downloadSources,
                                      boolean downloadDocs,
                                      MavenEmbedderWrapper embedder,
                                      MavenProgressIndicator p) throws MavenProcessCanceledException {
  return new MavenArtifactDownloader(project, projectsTree, mavenProjects, artifacts, embedder, p).download(downloadSources, downloadDocs);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:MavenArtifactDownloader.java

示例10: execute

import org.jetbrains.idea.maven.utils.MavenProcessCanceledException; //导入依赖的package包/类
@Override
public List<String> execute(@NotNull RepositoryLibraryDescription repositoryLibraryDescription, ProgressIndicator indicator) {
  MavenEmbeddersManager manager = MavenProjectsManager.getInstance(myProject).getEmbeddersManager();
  MavenEmbedderWrapper embedder = manager.getEmbedder(MavenEmbeddersManager.FOR_GET_VERSIONS);
  embedder.customizeForGetVersions();
  try {
    List<MavenRemoteRepository> remoteRepositories = convertRepositories(repositoryLibraryDescription.getRemoteRepositories());
    List<String> versions = embedder.retrieveVersions(
      repositoryLibraryDescription.getGroupId(),
      repositoryLibraryDescription.getArtifactId(),
      remoteRepositories);
    Collections.sort(versions, new Comparator<String>() {
      @Override
      public int compare(String o1, String o2) {
        MavenVersionComparable v1 = new MavenVersionComparable(o1);
        MavenVersionComparable v2 = new MavenVersionComparable(o2);
        return v2.compareTo(v1);
      }
    });
    return versions;
  }
  catch (MavenProcessCanceledException e) {
    return Collections.emptyList();
  }
  finally {
    manager.release(embedder);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:29,代码来源:MavenVersionsRemoteManager.java

示例11: resolveProject

import org.jetbrains.idea.maven.utils.MavenProcessCanceledException; //导入依赖的package包/类
@NotNull
public MavenServerExecutionResult resolveProject(@NotNull final VirtualFile file,
                                                 @NotNull final Collection<String> activeProfiles,
                                                 @NotNull final Collection<String> inactiveProfiles)
  throws MavenProcessCanceledException {
  return perform(new RetriableCancelable<MavenServerExecutionResult>() {
    @Override
    public MavenServerExecutionResult execute() throws RemoteException, MavenServerProcessCanceledException {
      return getOrCreateWrappee().resolveProject(new File(file.getPath()), activeProfiles, inactiveProfiles);
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:MavenEmbedderWrapper.java

示例12: evaluateEffectivePom

import org.jetbrains.idea.maven.utils.MavenProcessCanceledException; //导入依赖的package包/类
@Nullable
public String evaluateEffectivePom(@NotNull final VirtualFile file,
                                   @NotNull final Collection<String> activeProfiles,
                                   @NotNull final Collection<String> inactiveProfiles) throws MavenProcessCanceledException {
  return perform(new RetriableCancelable<String>() {
    @Override
    public String execute() throws RemoteException, MavenServerProcessCanceledException {
      return getOrCreateWrappee()
        .evaluateEffectivePom(new File(file.getPath()), new ArrayList<String>(activeProfiles), new ArrayList<String>(inactiveProfiles));
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:MavenEmbedderWrapper.java

示例13: resolve

import org.jetbrains.idea.maven.utils.MavenProcessCanceledException; //导入依赖的package包/类
@NotNull
public MavenArtifact resolve(@NotNull final MavenArtifactInfo info,
                             @NotNull final List<MavenRemoteRepository> remoteRepositories) throws MavenProcessCanceledException {
  return perform(new RetriableCancelable<MavenArtifact>() {
    @Override
    public MavenArtifact execute() throws RemoteException, MavenServerProcessCanceledException {
      return getOrCreateWrappee().resolve(info, remoteRepositories);
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:MavenEmbedderWrapper.java

示例14: resolveTransitively

import org.jetbrains.idea.maven.utils.MavenProcessCanceledException; //导入依赖的package包/类
@NotNull
public List<MavenArtifact> resolveTransitively(
  @NotNull final List<MavenArtifactInfo> artifacts,
  @NotNull final List<MavenRemoteRepository> remoteRepositories) throws MavenProcessCanceledException {

  return perform(new RetriableCancelable<List<MavenArtifact>>() {
    @Override
    public List<MavenArtifact> execute() throws RemoteException, MavenServerProcessCanceledException {
      return getOrCreateWrappee().resolveTransitively(artifacts, remoteRepositories);
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:MavenEmbedderWrapper.java

示例15: retrieveVersions

import org.jetbrains.idea.maven.utils.MavenProcessCanceledException; //导入依赖的package包/类
@NotNull
public List<String> retrieveVersions(@NotNull final String groupId,
                                     @NotNull final String artifactId,
                                     @NotNull final List<MavenRemoteRepository> remoteRepositories) throws MavenProcessCanceledException {

  return perform(new RetriableCancelable<List<String>>() {
    @Override
    public List<String> execute() throws RemoteException, MavenServerProcessCanceledException {
      return getOrCreateWrappee().retrieveAvailableVersions(groupId, artifactId, remoteRepositories);
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:MavenEmbedderWrapper.java


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