Showing posts with label linking external project to the workspace. Show all posts
Showing posts with label linking external project to the workspace. Show all posts

Wednesday, October 29, 2014

Linking external project to eclipse workspace without really moving the project content

If you wanted to access the external eclipse project resources without really adding them into eclipse workspace, below piece code will help to do that.


 privagte void linkProject(String projectPath) throws CoreException {

IProjectDescription description = ResourcesPlugin.getWorkspace().loadProjectDescription( new Path(projectPath + File.separator +".project"));

IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(description.getName()); 
project.create(description, IProject.FORCE, null);
 if (!project.isOpen()) {
   project.open(null);
   }

 }