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

Java ResolverConfiguration类代码示例

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

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



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

示例1: enableMavenNature

import org.eclipse.m2e.core.project.ResolverConfiguration; //导入依赖的package包/类
private static void enableMavenNature(IProject newProject, IProgressMonitor monitor)
    throws CoreException {
  SubMonitor subMonitor = SubMonitor.convert(monitor, 30);

  // Workaround deadlock bug described in Eclipse bug (https://bugs.eclipse.org/511793).
  try {
    IDependencyGraph.INSTANCE.preUpdate();
    try {
      Job.getJobManager().join(DependencyGraphImpl.GRAPH_UPDATE_JOB_FAMILY,
          subMonitor.newChild(8));
    } catch (OperationCanceledException | InterruptedException ex) {
      logger.log(Level.WARNING, "Exception waiting for WTP Graph Update job", ex);
    }

    ResolverConfiguration resolverConfiguration = new ResolverConfiguration();
    MavenPlugin.getProjectConfigurationManager().enableMavenNature(newProject,
        resolverConfiguration, subMonitor.newChild(20));
  } finally {
    IDependencyGraph.INSTANCE.postUpdate();
  }

  // M2E will cleverly set "target/<artifact ID>-<version>/WEB-INF/classes" as a new Java output
  // folder; delete the default old folder.
  newProject.getFolder("build").delete(true /* force */, subMonitor.newChild(2));
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:26,代码来源:CreateAppEngineWtpProject.java


示例2: test_p001_simple

import org.eclipse.m2e.core.project.ResolverConfiguration; //导入依赖的package包/类
public void test_p001_simple()
    throws Exception
{
    ResolverConfiguration configuration = new ResolverConfiguration();
    IProject project1 = importProject( "projects/castor/castor-p001/pom.xml", configuration );
    waitForJobsToComplete();

    project1.build( IncrementalProjectBuilder.FULL_BUILD, monitor );
    project1.build( IncrementalProjectBuilder.INCREMENTAL_BUILD, monitor );
    waitForJobsToComplete();

    assertNoErrors( project1 );

    IJavaProject javaProject1 = JavaCore.create( project1 );
    IClasspathEntry[] cp1 = javaProject1.getRawClasspath();

    assertEquals( new Path( "/castor-p001/target/generated-sources/castor" ), cp1[3].getPath() );

    assertTrue( project1.getFile( "target/generated-sources/castor/test/Tags.java" ).isSynchronized( IResource.DEPTH_ZERO ) );
    assertTrue( project1.getFile( "target/generated-sources/castor/test/Tags.java" ).isAccessible() );
}
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:22,代码来源:CastorGenerationTest.java


示例3: test_p002_simple

import org.eclipse.m2e.core.project.ResolverConfiguration; //导入依赖的package包/类
public void test_p002_simple()
    throws Exception
{
    ResolverConfiguration configuration = new ResolverConfiguration();
    IProject project1 = importProject( "projects/castor/castor-p002/pom.xml", configuration );
    waitForJobsToComplete();

    project1.build( IncrementalProjectBuilder.FULL_BUILD, monitor );
    project1.build( IncrementalProjectBuilder.INCREMENTAL_BUILD, monitor );
    waitForJobsToComplete();

    assertNoErrors( project1 );

    IJavaProject javaProject1 = JavaCore.create( project1 );
    IClasspathEntry[] cp1 = javaProject1.getRawClasspath();

    assertEquals( new Path( "/castor-p002/target/generated-sources/castor" ), cp1[3].getPath() );

    assertTrue( project1.getFile( "target/generated-sources/castor/test/Tags.java" ).isSynchronized( IResource.DEPTH_ZERO ) );
    assertTrue( project1.getFile( "target/generated-sources/castor/test/Tags.java" ).isAccessible() );
}
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:22,代码来源:CastorGenerationTest.java


示例4: importBuildHelperProject

import org.eclipse.m2e.core.project.ResolverConfiguration; //导入依赖的package包/类
private IProject importBuildHelperProject( String name )
    throws Exception
{
    ResolverConfiguration configuration = new ResolverConfiguration();
    IProject project = importProject( "projects/buildhelper/" + name + "/pom.xml", configuration );
    waitForJobsToComplete();

    project.build( IncrementalProjectBuilder.FULL_BUILD, monitor );
    waitForJobsToComplete();

    assertNoErrors( project );
    return project;
}
 
开发者ID:ContaAzul,项目名称:maven-formatter-plugin-old,代码行数:14,代码来源:BuildhelperTest.java


示例5: addProjectEntries

import org.eclipse.m2e.core.project.ResolverConfiguration; //导入依赖的package包/类
protected void addProjectEntries(Set<IRuntimeClasspathEntry> resolved, IPath path, int scope, String classifier,
      ILaunchConfiguration launchConfiguration, final IProgressMonitor monitor) throws CoreException {
    IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
    IProject project = root.getProject(path.segment(0));

    IMavenProjectFacade projectFacade = projectManager.create(project, monitor);
    if(projectFacade == null) {
      return;
    }

    ResolverConfiguration configuration = projectFacade.getResolverConfiguration();
    if(configuration == null) {
      return;
    }

    IJavaProject javaProject = JavaCore.create(project);

    boolean projectResolved = false;

    for(IClasspathEntry entry : javaProject.getRawClasspath()) {
      IRuntimeClasspathEntry rce = null;
      switch(entry.getEntryKind()) {
        case IClasspathEntry.CPE_SOURCE:
          if(!projectResolved) {

            IMavenClassifierManager mavenClassifierManager = MavenJdtPlugin.getDefault().getMavenClassifierManager();
            IClassifierClasspathProvider classifierClasspathProvider = mavenClassifierManager
                .getClassifierClasspathProvider(projectFacade, classifier);

            if(IClasspathManager.CLASSPATH_TEST == scope) {
              classifierClasspathProvider.setTestClasspath(resolved, projectFacade, monitor);
            } else {
              classifierClasspathProvider.setRuntimeClasspath(resolved, projectFacade, monitor);
            }

            projectResolved = true;
          }
          break;
        case IClasspathEntry.CPE_CONTAINER:
          IClasspathContainer container = JavaCore.getClasspathContainer(entry.getPath(), javaProject);
          if(container != null && !MavenClasspathHelpers.isMaven2ClasspathContainer(entry.getPath())) {
            switch(container.getKind()) {
              case IClasspathContainer.K_APPLICATION:
                rce = JavaRuntime.newRuntimeContainerClasspathEntry(container.getPath(),
                    IRuntimeClasspathEntry.USER_CLASSES, javaProject);
                break;
//                case IClasspathContainer.K_DEFAULT_SYSTEM:
//                  unresolved.add(JavaRuntime.newRuntimeContainerClasspathEntry(container.getPath(), IRuntimeClasspathEntry.STANDARD_CLASSES, javaProject));
//                  break;
//                case IClasspathContainer.K_SYSTEM:
//                  unresolved.add(JavaRuntime.newRuntimeContainerClasspathEntry(container.getPath(), IRuntimeClasspathEntry.BOOTSTRAP_CLASSES, javaProject));
//                  break;
            }
          }
          break;
        case IClasspathEntry.CPE_LIBRARY:
          rce = JavaRuntime.newArchiveRuntimeClasspathEntry(entry.getPath());
          break;
        case IClasspathEntry.CPE_VARIABLE:
          if(!JavaRuntime.JRELIB_VARIABLE.equals(entry.getPath().segment(0))) {
            rce = JavaRuntime.newVariableRuntimeClasspathEntry(entry.getPath());
          }
          break;
        case IClasspathEntry.CPE_PROJECT:
          IProject res = root.getProject(entry.getPath().segment(0));
          if(res != null) {
            IJavaProject otherProject = JavaCore.create(res);
            if(otherProject != null) {
              rce = JavaRuntime.newDefaultProjectClasspathEntry(otherProject);
            }
          }
          break;
        default:
          break;
      }
      if(rce != null) {
        addStandardClasspathEntries(resolved, rce, launchConfiguration);
      }
    }
  }
 
开发者ID:fbricon,项目名称:wildfly-hive,代码行数:81,代码来源:MavenRuntimeClasspathProvider.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java HistoricActivityInstanceQueryImpl类代码示例发布时间:2022-05-22
下一篇:
Java JobEntryDeleteFolders类代码示例发布时间: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