1.6. Project cloning

1. Duplicating an existing Eclipse project

The procedure described next is probably not the simplest way to duplicate a project, but it is safe. Although you can copy/paste a project directly from the Project Explorer within Eclipse, some paths are not well updated and you may mess up existing projects.

1.1. Copy the source project folder

Let us now create a copy of the ‘nucleo64_F072RB_template’ project under the name ‘my_project

Using Windows, navigate into your workspace folder ‘tuto_workspace’ and copy/paste the ‘nucleo64_F072RB_template’ folder:


Then, rename the new folder with the new project name you want:


Put that name into the clipboard for what’s coming:



1.2. Clean/Update new project folder

Now open the my_project folder:
Delete the Debug folder (these have been produced during build).



Now, open both .project and .cproject files into a text editor (preferably notepad++). Replace every occurrence of ‘nucleo64_F072RB_template’ by ‘my_project’. It’s better to use an automatic find/replace utility if available:



  • In the .project file, there is usually only one occurrence within the <name> tag:
  • In the .cproject file, there are several occurrences. In this example, 3 replacements were performed, but you may have more…


Save and close both .project and .cproject files. The my_project folder is now as below:



2. Import the new project into the Atollic® workspace


Launch Eclipse if not yet.
Go to File → Import


Choose Existing Project into Workspace and click Next


In the next dialog:

  • Put your workspace path as the Select root directory
  • Tick the project you want to import
  • Clear other options (we don’t need to copy project, it is already there)



Then click Finish.

The new project my_project is now displayed in the Eclipse Project Explorer:



You should be able to build it image010.png without problem since all the build options you have set in the source project have been preserved during the cloning operation:



3. Run/Debug configuration

The Debug/Run configurations are not copied, therefore you need to do it again for the cloned project:

  • Open Debug Configurations
  • Create a new configuration under Embedded C/C++ Application category:


  • Check that Main tab is all right:
  • Open Debugger tab and set the correct Debug probe:

That’s basically all you have to do. You can close the debug configuration windows and start working with the new project.


4. Summary

In this tutorial, you have learned a way to make clean duplicate of existing projects within Eclipse in order to start a new project using a previous one as a starting point.
The project my_project will be used all along the next labs.