I have been working with Mathematica for a while and have accumulated a number of folders (not in Workbench project form), each with a few files such as a .nb file, maybe a .m file, and their products (images etc.).

I then acquired Wolfram Workbench, and am up and running, and wish to transfer my existing folders to Workbench. If I try

File -> Import -> General -> Existing Projects into Workspace -> Next

and select the directory that contains my folders, the information up the top of the dialogue box says, "No projects are found to import".

If I simply transfer my folders to the base Workbench directory, they are not visible in the Package Explorer or Navigator even after pressing F5 (Refresh).

Any ideas?

PS $\hspace{5mm}$ After experimenting a little more, I've discovered that I can go

File -> New -> Project -> Mathematica -> Basic Project

and create a project with the same name as the folder I wish to import; then paste the contents of my folder into the project folder. This is a work-around, but what I'd really like to do is import all of my existing folders into the base workspace and have Workbench recognise them as projects (and create the necessary infrastructure around them if need be), without my having to faff around creating projects manually.


1 Answer 1


Wolfram Workbench (and Eclipse in general) recognizes a directory as a project, if it contains special project description file.

I don't know any "batch project creation" functionality in Workbench, but you can easily programmatically add necessary files to your folders with Mathematica.

Description file for Mathematica projects looks like this:

template = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>

where `1` is a placeholder for project name.

Take all relevant directory paths:

directories = 
        FileType[#] === Directory &

and create description files with project names same as directory names:

    FileNameJoin[{#, ".project"}], 
    ToString[StringForm[template, FileNameTake[#]], StandardForm], 
] & /@ directories

Now you should be able to import "Existing Projects into Workspace".


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.