What is difference between Project Path and Workspace in spring Tool suite? - eclipse

There's an option to start a project in Spring Tool Suite we can select our Project path and Workspace. Where I need to choose if I need to save project files?
I need to save files on D:\3rd year\SQA location. Where I need to put this, in Project path or Workspace?
Updated
In this window when I click "Add a local project" link in below the above window appear.

The workspace is a concept of Eclipse and contains the metadata for settings and which projects belong to the workspace. You can put your projects into your workspace folder, but you don't have to. You can put your projects anywhere you like. And you can import projects from anywhere into your workspace.
When creating new projects in Eclipse/STS, the wizard usually asks you where to store the project itself. The default is often set to the workspace location, but you can change that and put the project anywhere.
Therefore, in your example, the project path is probably the path where your project itself is stored (or will be stored), whereas the workspace location is the location where your workspace metadata information will be stored.
Hope this helps!

Related

what should keep in mind before providing work space for eclipse?

This is how the workspace assign on an eclipse
My Web project run only when my project is at c:\Ampps\www\myProject but eclipse contains it on C:\Simple\workspace\myProject. My problem is I want to run project and the workspace is different. What is the things keep in mind before choosing the workspace. And what are the alternatives if the wrong workspace choosen ?
Eclipse does not require your projects to live under your workspace folder. Therefore you are allowed to have a project and workspace as you describe.
When creating a project, uncheck the default location checkbox in the wizard and select your truly desired location.
My only recommendation on workspace location is to have it on a local drive and don't have it as a sub directory of any project in your workspace.

What is the runtime-EclipseApplication folder for, and can I delete it safely?

I'm trying to organise the directory structure of my projects' source code and the eclipse workspace etc.
I found a folder called runtime-EclipseApplication in a high level folder outside the directories where I keep my workspace and projects.
What is this folder, when/why is it created and is it safe to delete?
This is the default for the workspace name when you use Run As > Eclipse Application.
You can look in the Eclipse Applications section of the Run > Run Configurations dialog to see what (if anything) is using this workspace. The workspace name is shown in the Location field of the Main tab.

eclipse workspace: how to rename workspace

There is no option in the file menu to rename a workspace. Is the recommended practice to close eclipse, rename the folder, and re-open? I worry about some potential dangling references in configuration files corrupting my workspace/projects...
Thanks!
Source : Renaming a workspace?
Yes, you can just rename the workspace
directory and/or move it. However, you
then have to tell Eclipse where the
new workspace is. In 3.1, you can use
'switch workspace' to launch in a
different location (under the File
menu).
If you want to change it by hand, you
can edit the appropriate entries in
the files in the 'configuration'
directory where Eclipse is stored.
You can change the
org.eclipse.ui.ide.prefs file to set
SHOW_WORKSPACE_SELECTION_DIALOG=true
if you want to be asked each time
Eclipse is run where the workspace is.
For simple renaming, it is not necessary to switch workspaces, unless the workspace you want to rename is not the one currently active.
Anyway, you can rename the current open workspace by choosing Eclipse->Preferences->General->Workspace and changing the option "Workspace name (shown in window title)" from the default's workspace folder name to whatever you want to call it. Then, restart Eclipse.
Suppose your workspace's folder is "/foo/bar/workspace" and you never changed its name before; its name was then the default "workspace". After you renamed it to, say, "my_workspace" and restarted Eclipse, the Eclipse's window title should show: "my_workspace - (some stuff that varies) - /foo/bar/workspace".
Note that this is NOT going to modify the workspace folder's name. You may have to create a new folder with the desired name, switch to that folder (whose workspace will have the same name, by default) and import existing projects into it, as some have suggested here.
Renaming Workspace folder worked for me. Close the eclipse, rename the workspace folder name, launch eclipse again. If you are using any project dependencies like user libraries,launchers etc, you have to relocate those to new location manually, from project build path.
Copying workspace to a new folder works. Any reference Eclipse itself needs is resolved using the relative workspace location. If you have added launchers, substitution variables, etc. that rely on the absolute workspace location, they will need to be reset.
John,
I think in the original workspace you imported projects and that the projects depend on links not on being physically in the same location of the worspace (even thay are there already but the dependency is on links). If so you have to remove the projects from the new (copied) worspace and then re-import them again.
I just did a:
File --> Import --> Maven --> Existing Maven Projects --> mention the new workspace location in "Root Directory" in the "Import Maven Projects" window
and it worked! All projects were imported properly.
BTW, I have Eclipse-Maven plugin "m2e" installed (http://wiki.eclipse.org/M2E_updatesite_and_gittags)
2021 Update
In Eclipse 2020-12 (Windows 10), the "Workspace name (shown in window title)" preference mentioned in one answer is no longer there. Now, renaming a workspace (WS) requires a copy and delete operation.
Start by switch to another WS: File --> Switch Workspace --> select existing WS. Then rename the WS folder to desired new name. Switch to the new workspace folder and delete the old name:
File --> Switch Workspace --> Other...
Right-click old WS name --> Remove from launcher selection
Click Browse --> select new workspace folder --> click Launch and Voila!
As mentioned in prior posts, depending on your setup some resource links may be broken. Delete the project without(!) removing it from disk, then import to new WS.

How do I associate my custom ANT builder with the project instead of the Eclipse workspace?

I'd like to associate some ANT targets with my project's build in Eclipse.
No problem, I create a custom ANT builder, specify targets to run, all is well.
But then I realize that the builder information is saved in the workspace instead of the project! Why is that, and how do I fix it?
The goal is that anyone who imports the project in a new Eclipse workspace can build it without adding the builder manually. This means that I should have the builder configuration under source control, which means it should belong to the project, not the per-user workspace.
Maybe I'm just missing something?
There is a bit of confusion, it seems, because builders look like launchers, but they are stored in a different directory. Simply creating the .settings dir and copying the xml doesn't help...
When I create the .externalToolBuilders directory under .settings and copy the launcher/builder there, I get this:
Solution:
I restarted from scratch, deleted the project-specific data in the workspace directory, but left the .settings dir in the project dir. Re-created the builder/launcher, and Eclipse automatically created it in the correct place, and also added it to source control.
Indeed, your launcher (Run/Debug launchers or External Builders launchers) are saved by default in the workspace.
<workspace>\myProject\.externalToolsBuilder)
You can move that directory (.externalToolsBuilder) manually in the .settings directory of your project.
And uncheck the option "Delete configurations when associated resource is deleted" as mentioned in this SO answer.
With a full refresh of the project (or even a delete, followed by a reimport), your local version of .externalToolsBuilder should be taken into account.
For the Debug/Run launchers (not your case), you also can (since Eclipse3.4) use one of the Import wizards:
File > Import
type launch configuration, and you can import said configuration directly within your project.

Importing/Exporting Project Preferences

Having a bit of a problem,
Due to the source-control set-up we use, each bug/enhancement is worked on in a new branch. This is fine, but when in Eclipse, we need to set-up a new project for every branch.
Is there any way of easily setting up default preferences for a project, or importing/exporting project preferences within Eclipse?
Thanks,
Stuart
One possible solution would be to store those common preferences at the workspace level for Eclipse (see Manage your Eclipse environment article)
The downside of having multiple workspaces is the need to share development preferences among them.
Since preferences are persisted on a workspace basis within Eclipse, you have to export your workspace preferences and import them to your desired workspaces (File > Export > Preferences).
Even if you stay in the same workspace (with several projects), you can share common settings with other developers by exporting those workspace preferences.
As mentioned by Fabian, the project specific settings are in .classpath and .project, but he left out .settings:
.settings are for IDE project-specific settings like compiler warnings and so on.
It you want to share project-specific IDE-related settings, just copy the .settings directory from project directory to project directory.
Tips: copy your project launcher (created by default in <workspace>\.metadata\.plugins\org.eclipse.debug.core\.launches) into your .settings directory: that way, you will also share your custom project launchers.
The above methods might work in some settings but do not address the problem of exporting a single project from your workspace including its properties for use by another person.
One way of doing this is to export the project folder as a zip archive as described above but also save the following file from your workspace:
.metadata/.plugins/org.eclipse.core.resources/.projects/MYPROJECT/.indexes/properties.index
where MYPROJECT is your project name.
If you then import the project as a new project in a different workspace you can afterwards
copy this file into your new workspace metadata and you will have the original project properties.
The project-specific settings (contrary to the already mentioned workspace-specific settings) are stored in two hidden files in the project: .classpath and .project, which you might be able to reuse to setup your projects.
Have a look at Workspace Mechanic