I have a work space for eclipse for a particular project, which contains many small projects, it's a workspace for my hackkerrank progress.
I'm using my laptop at home and lab computers at uni, and I use github to keep them on sync.
I use source tree and git command line as version control tools.
And I gitignored .metadata folder because the workspace setting is different on different computer therefore it won't cause a chaos.
However, it causes a problem: though I can keep every project files on sync, whenever i create a new project in the workspace from one computer, the new created project won't show up in the other computer's eclipse project explorer, I know there is import function but that is not exactly what i want, because it is to import some project into the workspace, but I am in the workspace already with all the files/projects there, I just want some reference so there eclipse can see the projects.
Any help would be greatful
Related
I am working with Eclipse everyday, and I have a good 80 projects in my workspace, well organized.
We are using version control for our projects.
Every once in a while, we create a new branch.
I have to work on different branches everyday, so I like to keep them locally.
So basically, my file explorer looks like this :
- dev
- eclipse_workspaces
- workspace_16
- workspace_17
- workspace_trunk
-source
-trunk
-project1
-project2
-....
-branches
-1.6
-project1
-project2
-....
-1.7
-project1
-project2
-....
Each workspace is set up to work with one of the branches.
The main issue I have is that every time we create a new branch, I have to start my workspace over.
Reconfigure all my settings, recreate my working sets, and reimport all my projects by hand.
It looks to me like it should be possible to "clone" an existing workspace, and just change the project's location from "C:/dev/source/trunk" to "C:/dev/source/branches/1.7" for example.
I found other solutions on how to do it for ONE project, but I basically want to do that for ALL my projects every time.
I also created a small java program to automate this idea, but without luck so far. On top of it, this solution would slowly get outdated as new projects use a different system, with tree files.
Has anyone ideas on how to "clone" a workspace, while only changing the location of the projects?
I think you can use Workspace Mechanic for this.
Refer posts:
How can I set up Eclipse workspace mechanic to share settings?
How Do You Set Eclipse's Default Settings for When You Create New Workspaces?
How to import a preference file in eclipse with the launch of eclipse?
Eclipse sync workspaces/perspectives/preferences across computers
This solves:
Importing preferences on each and every new workspace.
Also in eclipse luna when switching workspace it ask whether to copy settings like workbench layout and working sets. select these options while switching workspace.
Look at Share / Export eclipse working sets.
You can copy an existing workspace, delete its projects (the working sets will stay), and import all projects from the new branch in one step. The existing working sets will be empty, but you can adjust them on demand (only when you want to open it) with 'Edit Active Working Set...'.
I frequently have multiple SVN working copies checked out. For example, I may have trunk-merge for merging branches into trunk, trunk-review to review other people's changes, and trunk-feature1 to trunk-featureN for work started. These all have the same repository URL.
If I import one of these projects into Eclipse (Kepler, Build id: 20130614-0229, Mac OS), that works fine. But I cannot import another one because these would have the same project name and Eclipse cannot handle that. To switch between my working copies, I now have to close the project, delete it from Eclipse, and import another one. Then Eclipse takes its 5 minutes to scan, index, and compile everything. In some older Eclipse versions I could use a symlink as described in
Eclipse Workspace/Project Setup Using Symlinks but that does not seem to work anymore on Eclipse Kepler (it resolves the symlink when importing the project).
I know that I could use feature branches on the trunk-featureN working copies, but often the features are not big enough for a branch, and eventually merging becomes a nightmare.
I do not want to use SVN switch on the workspace because in many cases the working copies will be modified.
How can I easily switch between (modified) working copies of the same project in Eclipse?
If you can't or don't want to change the project name based on the working copy (admittedly, that's a bit of a pain), then the best option is to use separate Workspaces. If you're not familiar with Eclipse's concept of workspaces, the gist is that a Workspace is a logical container of projects and metadata (eg, stuff you configure in the Preferences dialog). Projects that are logically part of a workspace do not have to be physically located in the workspace folder, although that's the default location when creating a new project unless you tell it otherwise. You can even import the same project into different workspaces, if you want.
In you case, I recommend using File > Switch Workspace... > Other... to create a new workspace in which to import a different working copy of your project. You can even export/import Preferences from one workspace to another.
Recently, my work computer was suffering hardware failures so I had the pleasure of migrating data over to a new computer. A project itself is much smaller than the generated output and a significant portion of time was spent moving those generated output.
Currently:
C:\workspace\Project\src\...
C:\workspace\Project\bin\...
Ideally:
C:\workspace\Project\src\...
C:\workspace_output\Project\bin\...
NOTE: For me the source is linked so they don't actually exist within the project.
I was able to change one particular project by following the directions here. However, I have numerous projects and it would be a fairly time-consuming to apply that change to each project (create an "output folder" then point the project to that folder).
Is there a better way to define this behavior within Eclipse? I couldn't find a ${PROJECT_NAME} system variable that I could use (e.g. something like this). I'm fine if the answer is NO as it appears that I have to manually set this for each project. Maybe the next best thing is to write a script to automatically create folders and modify the .project and .classpath.
An alternative like:
Start Eclipse on new machine, point it to the old workspace
Clean projects
Then copy projects onto new machine
Use Eclipse on new machine.
where I can cut out the work of "cleaning" the projects because they are already separate.
In general you'd want to use some kind of version control system or source code management, such as cvs, svn, git, Perforce, Visual SourceSafe, etc. Barring that, you can also use File > Export (or right-click on projects) to export a project or group of projects from Eclipse and it will, by default, exclude any derived content (such as compiled code). Then you can import those projects into another Eclipse workspace.
We are using subclips as a SVN client for our Eclipse and I have successfully checked-out the list of projects to 'C:\workspace\myprojects' folder then I have opened the eclipse and given the workspace location as 'C:\workspace\myprojects' but it's not showing any projects even there are projects, Why?
So I have imported all the projects one by one through the eclipse feature and now i can able to see the projects but my question why should i need to import even i have given the eclipse workspace folder as 'C:\workspace\myprojects'?
NOTE: But the sampe scenario is working fine in others machine, i.e they no need to import all the projects one by one when they have given the Eclipse workspace folder as 'C:\workspace\myprojects'.
Regards,
Baji
Eclipse uses the metadata to determine which projects are in the workspace. So you have to import the projects into the workspace even though they already reside in the same directory in the filesystem. Just call File / Import / Existing Projects from the filesystem and select the projects that are already there. It's a pain, but it works.
Just because you have a project inside the workspace directory doesn't mean Eclipse opens it or even sees it automatically. You must use File - Import - General - Import existing project into workspace to have your project in Eclipse.
Actually some of eclipse configuration file was deleted. hence it was not able to show.
finally after reverting the it I can able to see all the projects.
When I make changes to my working directory outside of Eclipse, in particular when I update my project under version control, newly added files will frequently not show up in the package explorer. Usually they'll show up after about 5 or so minutes (no idea why) but today it's been an hour and I kind of need these files so it's getting to be a problem. I tried:
restarting eclipse
cleaning and building the project
opening one of the missing files using File > Open File
The last of these opened the file but didn't get it to show up in the package explorer, and the type represented by that class was still invisible to other classes. Any thoughts?
As discovered, you need to refresh your workspace or project to see changes made to the filesystem outside of eclipse.
The eclipse workspace manages access to the files it controls, fires deltas on file changes to allow incremental builders to operate, etc.
The way to refresh the workspace is to select your project name in Package Explorer and press F5.