Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » How to run import project wizards from headless mode
How to run import project wizards from headless mode [message #698486] Tue, 19 July 2011 14:45 Go to next message
Jon Svede is currently offline Jon Svede
Messages: 83
Registered: July 2009
Member
Hi,

This may not be the right forum for this topic; if anyone knows where the right place would be, let me know.

I am working on a project that has an ant script that does a checkout on a bunch of projects and the calls mvn eclipse:eclipse on them to prepare them for use in Eclipse. I'd like to find a way to also build an eclipse workspace and import these projects during that process. The goal being to be able to open eclipse, point to this new directory and have eclipse recognize the projects in the workspace without having to run the import wizard in eclipse. These are web projects, not plugins.

Currently I find that if I do the 'mvn eclipse:eclipse' and then start eclipse and point to the directories where the project live, I still have to import these projects.

Any suggestions? I was hoping there would be a mvn plugin or an ant task of some kind (but I've not been able to find any such references on the web. Is it possible to run the import wizard from headless mode?

Thanks,

Jon

[Updated on: Tue, 19 July 2011 15:32]

Report message to a moderator

Re: How to run import project wizards from headless mode [message #698585 is a reply to message #698486] Tue, 19 July 2011 18:49 Go to previous messageGo to next message
Paul Webster is currently offline Paul Webster
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

There are operations like org.eclipse.ui.wizards.datatransfer.ImportOperation that can be run programmatically ... although they appear to need the workbench running in order to work. See org.eclipse.ui.internal.wizards.datatransfer.WizardFileSystemResourceImportPage1.importResources(List) for an example of how the File System Import wizard uses that operation.

Another potential option would be to write a little headless app that includes org.eclipse.core.resources, starts up, and does a refresh on the workspace you pointed it to. You might need a little more code than this, but the basic idea would be:

ResourcesPlugin.getWorkspace().getRoot()
    .refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());


PW


Re: How to run import project wizards from headless mode [message #698931 is a reply to message #698585] Wed, 20 July 2011 13:55 Go to previous message
Jon Svede is currently offline Jon Svede
Messages: 83
Registered: July 2009
Member
Thanks, Paul! I assumed it was probably something that would require the workbench, I just didn't know where to start looking. I'll take a look at your suggestions. -- Jon
Previous Topic:[solved] popupMenus on IMarker
Next Topic:How to achieve lightweight workspaces
Goto Forum:
  


Current Time: Mon Sep 22 02:16:53 GMT 2014

Powered by FUDForum. Page generated in 0.01797 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software