Tfs check out and mapping issue - java

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?

Related

Deleting Java project and then creating the same one in the same directory - Eclipse

I'm having difficulties creating a Java project in Eclipse on the same location where the deleted project was. What happens when I change the new project location to the one where the old project was is all my options become grayed out. I cannot select the JRE or change the project layout. I cannot pick whether I want to create module-info.java file or not. It seems like Eclipse somehow knows there was a project on the same location. If that is the case, how can I delete Eclipse Project creation history?
New Java Project dialog info message:
The wizard will automatically configure the JRE and the project layout based on the existing source.
When you delete a project in Eclipse, you get a dialog like this:
As you can see, the default is that the project content is not delete, only the project registration in Eclipse.
Since the actual project files are left on disk, you can "import" the project back into Eclipse, using File > Import....
When you try to create a new project, but select a folder on disk that already contains a project, the "Create Project" dialog automatically becomes an "Import Project" dialog.
If you don't want to import that project, either select another folder, or delete the folder first.
Next time you delete a project, check the Delete checkbox, so all the project files and source files are deleted too.
Make sure you have deleted all the hidden files in the directory.
Make sure it's deleted on your machine in your file explorer. If it's not deleted correctly it can still be save on your machine.

Checkout issue in tfs

i have added a workspace(c:/users/aparna/workspace)and checked out the codes there. Due a mapping issue i changed the workspace, that is i created a new one (d:/noscript). When i tried to check out the project modules to this new workspcae from tfs, it is already mapped to the old workspace. When i open new workspace folde, .metadata and remotesystemTempFiles are seen. Projects modules still resides in old workspace. When i open eclipse by selecting new workspace, i got all project modules resides in old workspace.. what is the reason for this? Will it make any performance issue?
In TFS, one workspace does not allow the same TFS folder to be mapped to more than one local directory.
However, you can have two or more workspaces for one computer, and each workspace can map a TFS folder to a different local folder. Seems your project modules already mapped with the old workspace.
This will not cause any performance issue. But what revisions of files are in each workspace is tracked separately (to keep each up to date you need to do a get in each) One easy way is using tf get from the command line.
If you don't want to track files separately in two workspaces, you could remove the mapping with old workspace for all the project modules. Select the old worksapce, go to Team Explorer-> Source Control - Right click on folder/project you've got before - Select Remove Mapping
Then you could remap and get latest in the new workspace.

Eclipse: Multiple projects with same name but different location

I have two copies of the same directory structure (basically, trunk and a feature branch) which both contain a Java project (call it ProjectX) in a subdirectory of the respective base directory.
I have painstakenly set up Eclipse the way I want it to work with regards to settings, colors etc.
Now, I want to be able to switch between working in either trunk\ProjectX or featurebranch\ProjectX. These are completely separate on disk (which is why I feel that the accepted answer to How to create multiple projects with same name in Eclipse? does not address my concern), but since they share the name ProjectX on disk, Eclipse doesn't seem to want to let me add them to the same workspace.
Working sets don't help me because the projects are not (yet) in the same workspace.
Removing and re-adding the projects very quickly becomes error-prone.
Making a copy of the workspace directory and opening that seemed to lose quite a few of my settings (colors, servers, etc.) (why that is is another interesting question) and as far as I could tell, there was no easy way to tell which workspace I am actually working in right now.
My question: What is the recommended way to deal with a situation like this?
I guess I am hoping for some way to define an alias of some kind, such that I can add trunk\ProjectX as TrunkProjectX and featurebranch\ProjectX as FbProjectX, then use working sets to switch between them.
Eclipse has a showlocation parameter:
eclipse.exe -showlocation
This will show the location of the workspace in the title bar.
I use an extra workspace for each branch. That way I feel secure, that I don't accidentally forget something and change trunk instead of branch.
For maven projects, that have same name use Advanced->Name templates (I prefer groupId.artifactId) while importing them into the same workspace
For eclipse projects, edit .project file and change <name> under <projectDescription>
I've used the following process, and it's worked for me:
Import both projects using the following steps:
Choose "File | Import" from the menus
Choose "Existing [Project Type] into Workspace", where [Project Type] is the type of project you're importing (e.g. Android)
Choose "Next"
Browse for your Project folder using the "Browse..." button
Before clicking "Next" or "Finish", change the "New Project Name" field entry to a unique name.
The project name is just a string in the .project file, so you could edit the file outside Eclipse before opening the project in Eclipse.

eclipse workspace synchronization via dropbox - move the .metadata folder

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.

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