I want to create several workspaces which point to different branches of a codebase.
The problem I am facing is every time I need to create a new workspace I have to do the same configuration for each workspace.
Example:
Setting up tomcat configuration and it's related java options such as library and java agent settings.
A system variable that points to specific folder containg my jar files.
Another system variable
Questions:
is it possible to have these setups done once so that all subsequent workspaces do not need to be configured?
is it possible to export these preferences and import later into any workspace either on my machine or other machine?
System information:
Windows 7, Eclipse 3.5, Sysdeo tomcat plugin, Tomcat 6
While eclipse does have an Export preferences option, it does not export everything and specifically it is not comprehensive enough for workspace duplication.
In the past I have had a lot of success just cloning the physical workspace folder itself.
For example, let's say you have setup the workspace with everything that you want in it. To duplicate it, find out the path of the current workspace folder by going to File -> Switch workspace -> Other. The path shown here in the dialogue that pops up is the current workspace path ( don't press ok yet)
Create a copy of this folder. Now to use this copy, just use it in the above dialogue, i.e., go to File -> Switch workspace -> Other and put in the path of the copy. Press OK and Eclipse shall restart with the new workspace. Now the only thing you will have to do is point the code to a different branch. Rest all the settings should be present already.
This works specially well on the same machine. If you copy this workspace folder it should still work but your mileage may vary.
Related
I have an Eclipse PyDev project (Eclipse 4.7.3a). I want to be able to sync the Eclipse workspace between several computers (and that it works, obviously).
First problem : the Python virtual environment. I have installed it in a folder that is located next to the Eclipse workspace (but not inside it) and is also synced between the various computers.
Since the folders for the workspace and the Python virtualenv are not located at the same point the of file system (I use Linux), my guess the simplest way to achieve this would be to use some kind of environment variable, different on each computer, that would point to the directory that contains all the synced folders.
So how can I set a Python virtualenv using a kind of system environment variable ?
Or is there another way to achieve my goal (sharing and syncing an Eclipse workspace between several computers) ?
This is not currently possible.
The workspace has information which is dependent on the absolute paths and is not really shareable (unless you have a mirror in both computers with files in the same paths on both).
Some configurations can be saved in the project itself or in the user settings (the ones that can do that have buttons in the preferences page to save to a project / show from a project -- but note that the interpreter itself still doesn't have that).
Personally, what I do is save everything possible in the project and commit that to git (so, anyone using the project will use those same settings), and try to use the same paths on multiple machines.
In my work env, I have setup the eclipse project in my PC which includes some Workspace Environment Variables, setting Project dependency and setting User library (from a common network location).
Now my fellow colleague who has checked out the same source code goes through same steps.
Is there a way to reduce this clutter ?
From what I could see is that only the source project location is different from my PC and other PC.
Is there any that I could change my project locations during eclipse startup in the other PC ?
So I could easily retain the same settings on another PC with same workspace.
First steps:
Use a version control system to store and share your projects.
Check in everything that is contained in your workspace. That is not only your source code, but also the settings files in the hidden settings folder.
Do not use Window -> Preferences to modify Java settings (or other build related settings). Instead always use Project -> Properties to modify build related settings.
Never ever refer a network share or another location outside of your workspace. If you need a jar file which is currently on a network share, then check it into your version control system and afterwards check it out in your Eclipse workspace as local file.
Second step:
Use Maven for project materialization, dependency and other management.
I'm new to programming and IDEs. I never understood the concept of a workspace in Eclipse, and I don't understand it in Aptana.
With Eclipse I just put it into my web root. Not sure if that's the way to go?
Can someone explain what a workspace is and where it should go? And if not in the web root, then how do I launch a PHP page from within the EDI?
Thanks!
An Eclipse workspace is a directory where (generally) all of the files you are working on live and that stores all of the state (like preferences and such) for a single user of Eclipse. So when you create projects, they are located in the workspace. The workspace has some metadata files that control how Eclipses behaves for you.
Eclipse keeps a representation of the workspace internally, which means the workspace can get out of sync with the underlying files. To sync them up, do a right-click Refresh in the Package/Project Explorer.
Usually the workspace goes into some directory relative to your home directory, since it's private to each developer.
Workspaces are like folders where the project's files are.
When you have a local web server you could set the workspace to a new folder in the servers directory (or web root when the project should be in the main directory!) . If you want to add a new PHP-file in Aptana studio 3 just right click the workspace and select add new file (or sth. like that). After that you will be able to enter a file-name and it's gonna be saved in the workspace (folder). But of course you can also work without workspaces, just create the the PHP-File and edit it with Aptana.
First, Eclipse is not my native IDE -- I'm barely a n00b with it. I set up a project in a workspace that was actually in the directory of another client's project (I didn't really follow the whole workspace/project thing) and, in fact, now I can't even find the Eclipse workspace file to open it.
What I'd like to do is:
Open my eclipse project (/workspace?) -- I know where all the files are on disk, just not what to open in order to see them in Eclipse -- and
Move my project to a new workspace, which I guess I will put in a generic Eclipse-y place, and have that one workspace reference all my Eclipse projects.
(Is that the right way to do it? Does Eclipse dislike me being a one-project == one-workspace kind of guy?)
Please educate me regarding The Eclipse Way so that I can get back to work writing code.
Thanks!
Roughly a workspace (which is a directory) in Eclipse contains:
configuration (installed JRE, Servers runtimes, code formatting rules, ...)
one or more projects
You can of course have as many workspaces as you want (but only one can be opened at a time) and a project can also be part of different workspaces.
If you know where your sources are and want to move them to a new workspace here is a possible solution:
Start Eclipse and when prompted for a workspace choose where you want the workspace to be created (if directory doesn't exist it will be created). For example you can choose C:/Dev/Workspace/.
If you are not prompted, go to File->Switch workspace->Other
Once you are in your workspace you can import your exisiting project with File->Import then General->Existing Projects into workspace
Navigate to the folder containing your project sources, select your project and click finish
I don't know if it's a best practice or not but what I usually do is the following:
I have one workspace for each of my customer (workspace_cust1, workspace_cust2)
Each workspace references my commons library projects and add client specific projects
This way each time I change my commons library it's up to date in every workspace.
If you want to apply
one workspace = one project
You could to the following:
1) Copy the eclipse desktop shorcut
2) Modify the shortcut by appending "-data workspaceLocation "
I've discovered a curious thing on my Mac. At some point I apparently created two different Eclipse workspaces, one in /Users/username/workspace and the other in /Users/username/Documents/workspace (this may have happened as a result of some troubleshooting a while ago). I never knew until now that anything was amiss because the contents of both workspace folders are visible in the Eclipse Package Explorer.
I only just noticed because I'm trying to use Mercurial from the command line and couldn't find the project folder to create a repository. After some cursing I found the other workspace. The other strange thing is that from Eclipse's perspective, projects from both workspaces appear to be housed in /Users/username/Documents/workspace, even though some projects are only in /Users/username/workspace.
I believe the problem itself is easily solved (import things from one workspace into the other) but I want to understand why it is happening, and haven't been able to find anything about it elsewhere. My suspicion is that this is being caused by metadata that is telling Eclipse about the workspaces in both locations, and / or some Mac file system magic. However, I'm not sure where to start looking. Where I should begin? What might be causing this?
First, I personally prefer Eclipse to present me with a combo-box allowing me to select the workspace to be opened. You can set it in the preferences, under General -> Startup and Shutdown -> Workspace.
If you prefer not to be asked, you can specify the workspace explicitly in the eclipse.ini file (inside the Eclipse.app package) by using the -data switch (more about Eclipse.ini: http://wiki.eclipse.org/Eclipse.ini#Mac_OS_X_Example, all the switch options are in the Eclipse help).
Projects are not required to be inside the workspace. I like storing my work outside the workspace, since I usually share projects between workspaces. When creating a project, you can specify a location which is different than the default location. You can see the location of the project by right clicking it in the Project Explorer and selecting Properties.