Package org.eclipse.m2e.core.project

Examples of org.eclipse.m2e.core.project.IProjectConfigurationManager


            newIds[ids.length] = JavaCore.NATURE_ID;
          }
          projectDescription.setNatureIds(newIds);
          project.setDescription(projectDescription, monitor);
         
          IProjectConfigurationManager configurationManager = MavenPlugin.getProjectConfigurationManager();
            @SuppressWarnings("unused")
          IMavenProjectRegistry projectRegistry = MavenPlugin.getMavenProjectRegistry();
          MavenUpdateRequest request = new MavenUpdateRequest(false, true);
          request.addPomFile(project.getFile("pom.xml"));
          configurationManager.updateProjectConfiguration(request, monitor);
        } catch (CoreException ex) {
          Activator.getLogger().error(ex);
        }
      }
    });
View Full Code Here


public class MavenFacade {

  public void importProjects(IProgressMonitor monitor, File pomFile, String projectName, String groupId, String artifactId, String version) throws CoreException {
   
    IProjectConfigurationManager manager = MavenPlugin.getProjectConfigurationManager();
    ProjectImportConfiguration config = new ProjectImportConfiguration();
    Collection<MavenProjectInfo> infos = new ArrayList<MavenProjectInfo>();
    Model model = new Model();
    model.setGroupId(groupId);
    model.setArtifactId(artifactId);
    model.setVersion(version);
    model.setPomFile(pomFile);
    MavenProjectInfo info = new MavenProjectInfo(projectName, pomFile, model, null);
    infos.add(info);

    manager.importProjects(infos, config , monitor);
  }
View Full Code Here

    final List<IMavenProjectFacade> facades = getImpactedProjects(projectManager);

    if(facades.isEmpty())
      return;
   
    final IProjectConfigurationManager configurationManager = MavenPlugin.getProjectConfigurationManager();

    WorkspaceJob job = new WorkspaceJob(Messages.MavenWtpPreferencePage_Updating_Maven_Projects_Job) {
 
      @Override
  public IStatus runInWorkspace(IProgressMonitor monitor) {
        try {
          SubMonitor progress = SubMonitor.convert(monitor, Messages.MavenWtpPreferencePage_Updating_Maven_Projects_Monitor, 100);
          SubMonitor subProgress = SubMonitor.convert(progress.newChild(5), facades.size() * 100);
          //projectManager.sortProjects(facades, progress.newChild(5));
          for(IMavenProjectFacade facade : facades) {
            if(progress.isCanceled()) {
              throw new OperationCanceledException();
            }
            IProject project = facade.getProject();
            subProgress.subTask(NLS.bind(Messages.MavenWtpPreferencePage_Updating_Configuration_For_Project, project.getName()));

            configurationManager.updateProjectConfiguration(project, subProgress);
          }

        } catch(CoreException ex) {
          return ex.getStatus();
        }
        return Status.OK_STATUS;
      }
    };
    job.setRule(configurationManager.getRule());
    job.schedule();
  }
View Full Code Here

          try {
            ResolverConfiguration configuration = new ResolverConfiguration();
            configuration.setResolveWorkspaceProjects(true);
            configuration.setActiveProfiles("");

            IProjectConfigurationManager configurationManager = MavenPlugin.getProjectConfigurationManager();
            configurationManager.enableMavenNature(project, configuration, new NullProgressMonitor());

            configurationManager.updateProjectConfiguration(project, new NullProgressMonitor());
          }
          catch (CoreException e) {
            RooCoreActivator.log(e);
          }
          return Status.OK_STATUS;
View Full Code Here

TOP

Related Classes of org.eclipse.m2e.core.project.IProjectConfigurationManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.