eclipse workspace synchronization via dropbox - move the .metadata folder - java

I'm a student and have to work with Java and Eclipse. As we have teamprojects i have to sync my workspace with other students. The only problem i have is a folder called .metadata, right above my workspacefolder. Is there any possibility to change the path of this folder so that it won't be synced?

You can sync your project folder instead of the whole workspace.
If you want to share multiple projects you can put them in a sub-folder of your workspace and share only this sub-folder.
BTW, I recommend you using a real SCM like GIT or SVN that give you opportunity to ignore some file/directory.

Related

Tfs check out and mapping issue

I am confused with a mapping issue in TFS. I checked out the projects from TFS into my workspace without creating the TFS folder hierarchy. That is, I directly check out all the projects into my workspace. After that, my boss suggested me to check out the projects as TFS folder hierarchy. I checked out a project based on TFS hierarchy. That is, I root folders are created and that project checked out inside that. Now I have to move other projects that are directly checked out in the workspace into that root folder.
how can I do this? So I created a new workspace and tried to check out the code again. But currently, my local path is pointing to previous workspace folder.. how can I change this and fresh check out of those projects...?
According to your java, eclipse tag, seems you are using Team Explorer Everywhere Plugin for Eclipse.
Looks like you want to check out the files from TFS server to another(new workspace) instead of the old workspace(already mapped).
Then you need to remove the work folder mapping of your local path:
View the working folders for your Team Foundation Server workspace.
For more information, see View Team Foundation Server Workspaces and
the Working Folders.
In the Working folders list, right-click the row that corresponds to
the working folder mapping that you want to remove, and then click
Delete.
Repeat the previous step for any other mappings that you want to
remove, and then click OK.
Another way is through tf workfolder command from a command prompt
Type tf workfold -unmap LocalFolder, and then press ENTER. Replace LocalFolder with the path on your local computer that you mapped to that server folder. More information please refer this tutorial in MSDN.
If you don't need the old workspace any more, suggest you directly delete the old workspace in your develop machine. How to do this follow the answer in this question: How to remove a TFS Workspace Mapping?

Issues getting files from my friend to work on my eclipse?

My friend sent me a project from his eclipse workspace for me to take a look at, however when I tried to put the folder in my workspace it did nothing. I opened eclipse and nothing was there. So i tried to make my own project and just put the .java and .class files in their respected folders, but it still didn't work. Is there some special way I have to transfer them? I should also mention he has a windows computer and I have a mac if that makes any difference for file types like that. Thanks for the help!
If you can just take the .java files and paste them into your 'src' folder in a new eclipse project, you should have no issues. Just make sure you refresh your project in eclipse(right-click on project folder and click refresh, or click on it and hit f5).
This is what i normally do.
Suppose your eclipse workspace is D:\EclipseWorkspace and your project name is Project1.
Then i would copy Project1 in eclipse workspace on disk to have D:\EclipseWorkspace\Project1.
Then create a new java project in eclipse and when prompted for name provide name as Project1 (exactly same) and say finish. It will import the project automatically. Everything should be up :)

Copy a MyEclipse workspace for a new workspace

I have a my eclipse workspace as UniversityApp. I decided to copy from my workspace and rename it to UniversityApp.2. I copied original workspace with UniversityApp.2 name but project in new workspace still linked to UniversityApp folder(by seeing at Properties\Resource).
What is it solution?
my assumption is that your statement:
but project in new workspace still linked to UniversityApp folder
is not correct.
When looking at Properties/Resource the value for Path in should be UniversityApp in both workspaces. However the Location will be different, one will be ../UniversityApp/UniversityApp and the other will be ../UniversityApp.2/UniversityApp. So there is no link between your two UniversityApp projects.
I'm not sure how projects in your UniversityApp workspace got location pointers to the workspace itself as this is normally the default and doesn't need specifying. In this case, you will really have to import the projects into a new workspace. Multiple projects can be imported at the same time, so it's not much different from copying the whole workspace. Create an empty workspace folder and open MyEclipse for that folder. Go to File->Import->General->Existing Projects into Workspace. Click "Select root directory" and browse to the folder for the other workspace. Now click "Select All", ensure that the "Copy projects into workspace" is selected and click Finish.
The location of the projects is held in a file deep within the .metadata folder but there is a separate file for each project and the file isn't really editable, so importing is the easiest method and not much slower than a copy.
If you want to retain your settings from the old workspace, open MyEclipse for the old workspace then go to File->Export->General->Preferences. Select the preferences to export and specify a file to export them to. Click Finish. Then open MyEclipse for the new workspace and Import the preferences in a similar way.

How to commit project into trunk from Eclipse (via Subclipse)?

I have a project in Eclipse, MyProject/, that I want to share and import into my SVN repo:
MyProject/
src/
dist/
lib/
...etc.
Ultimately, I want to end up with an SVN repo for this project that looks like this:
svn://mySVNrepo/
MyProject/
trunk/
src/
dist/
lib/
branches/
tags/
But when I right-click MyProject and select Team >> Share, and follow the prompts, I end up with:
svn://mySVNrepo/
MyProject/
src/
dist/
lib/
So it's: (1) not allowing me to create trunk, branches and tags dirs, and (2) not allowing me to "nest" my imported project into trunk.
I then tried to create the directories manually from the SVN Repo Explorer view, and created:
svn://mySVNrepo/
MyProject/
trunk/
branches/
tags/
Then, I tried to share my project at:
svn://mySVNrepo/trunk
When I try to run this initial import, I get a warning from Eclipse:
Warning: The specified folder already exists in the repository. If you continue, that folder will be checked out to your local workspace and your project will be connected to this existing location. Do you want to continue?
I don't want to overwrite my local copy (that I'm trying to share); it has a lot of work in it!
I don't really understand what this warning is telling me, and basically I don't want to mess anything up!
So I ask: is my approach wrong, and if so, how can I commit my project for the first time into a trunk/ subdirectory? And if my approach is correct, then please help me decipher this warning message and advise on what I should do. Thanks in advance!
One approach that would work is to keep your manually created trunk/branches/tags directories in SVN. Check out the empty /trunk into a parallel directory on your local workstation (Let's say directory #2, with your local project as #1). Then copy your project + code from #1 into that /trunk directory and commit to SVN.
Then you can make a 3rd directory locally, and check-out your SVN copy and ensure it compiles/runs properly. If so you can delete the intermediate #1/#2 directories, or keep your initial project as a backup just incase (but it'll be non-versioned). Then continue to use directory #3 as your new SVN monitored workspace.
If I'm unsure how my changes will affect work that I don't want to lose, I try to take an approach like this so the least amount of harm is done to my code if something goes wrong (say with a SVN command/operation I'm unfamiliar with, etc).
From the menu, select Window > Open Perspective > SVN Repository Exploring
Right click your repository > New Project Structure > Single project or multiple projects layout > enter 'MyProject' for the Name. This will create the new project with the /trunk/branches/tags/ project structure.
Once it's created, right click the Project and select Checkout.
'MyProject' should now be in your Navigator View. From there you can copy your /src /dist and /lib folders into 'My Project' trunk folder.
Right click your Project and select Team > Commit.
EDIT:
You can also try the Subversive plugin for Eclipse. This plugin has an easier way to share your existing projects to svn as a multiple project layout (trunk/branches/tags folder structure).
I posted the steps in a similar thread.
After one hour of trial and error, I just did the following:
Share it to a wrong folder
Go into the SVN explorer and rename the folder (with src etc.) to trunk
Move that trunk to the correct location (e.g. Project/trunk) in svn
Got into the Project Explorer in Eclipse, right click on the project, team, switch and select the new trunk.

In Eclipse, how to have launch configurations relative to the project?

I usually have multiple copies of a project, for example: a copy of the trunk and another of the last release branch. To cleanly separate my project files from Eclipse, they are checked out from Subversion in a directory outside the Eclipse workspace.
I want to make the project easily importable to Eclipse and followed instructions from multiple answers.
The problem is that my .launch files have the project name hardcoded. When a new project is imported, the launch files will display in the Run Configurations menu just if the project has exactly the same name of the exported one. This forbids me to have two versions of the same project.
It looks like the only way to do it is to have the .launch and .project files generated from an Ant task, but I don't see anyone using this solution. Maybe I should have multiple workspaces and the project always with the same name.
What's the best way to do it?
Edit: I'm marking VonC as the answer, but don't miss the comments.
Remember that the .launch configuration files don't have to be in your workspace.
They can be in your <project>/.settings as I mentioned in the answer you refer to.
That means you cannot import in your eclipse workspace two versions of the same project.
You need separate workspaces (not versioned themselves), each one referring to a project in a different path.
Each path represents different working trees (like different working directories for Subversion).
The OP adds:
The project must have the same name, but the project checkout dir can have any name.
To make the launch file work, you have to reference any file using the variable ${workspace_loc:ProjectName}.
Java files can be referenced using a path like: '/ProjectName/src/package/MyFile.java'
This way, it is easier to use any tool to interact with the subversion repository.
I want to make life easier for who uses Eclipse, but I don't want to force anyone to use it.
My recommendation is to tie the workspace to the checkout location, and then you can use the launch configurations for the relevant projects in Subversion.
My directory structure looks like this:
{checkout root}
|
+code
|
-workspace
In your case, that would mean a workspace for the trunk, and any other branch/tag you check out. I also keep all my projects outside the workspace. The workspace directory in Subversion is empty; I just recursively add the project reference(s) to the workspace from the sibling tree. It also helps if you export your Eclipse settings, as you can then re-import them into each new workspace.
I derived this approach from a pair of IBM and Rational white papers for using Eclipse with Rational ClearCase. This should work unless you need to have multiple versions of the same project open in the same workspace.

Categories

Resources