How to restore svn information(url) of maven project - eclipse

I have accidentally deleted .svn directory from my maven project. Now when I started eclipse the projected shows no connections to svn repository. I am not able to assign the svn url to the project.
How can I assign the repository url to the maven project in eclipse to be able to synchronize.

First: make a backup. (zip the current folder)
Then: within eclipse you should be able to simply share the project (again) and select the SVN repository. Eclipse usually syncs the sources and the repository. Usually nothing gets lost in the process but better be safe and make a backup.
For maven no action should be required. There is the scm section in the pom.xml but that probably did not change. As long as no plugin reads the SVN revision number or you do a release locally maven will be fine.

Related

Git workflow: PDT + Egit on Eclipse workspace and Git bare repository

I'm developing a Symfony applicatoin and I'm trying to set up a Git workflow on Eclipse. The workspace (where the project files lies) are located on /home/sfprojects/testing/ and the Git repository is located on /var/git/testing.
Reading over and over all the Git resources I've could found (including "Pro Git" by Scott Chacón, and the EGit user guide (http://wiki.eclipse.org/EGit/User_Guide, among others), it's easy to understand why the Git repository and the Eclipse workspace should not share the same directory, now my big confusion is that I can not see a method to keep both things separated from each other.
Once I've created the Git repository through the wizard, all the project files are moved automatically from the Eclipse workspace to the working directory on /var/git/testing/testing/. For my big surprise, the new created Git repository became into the new project workplace on Eclipse with .git directory in the parent directory. It is not a obvious contradiction?. If I let the mouse pointer over the option "Use or create repository in parent folder of project" a very clear help tag with the following text:
When checked, this wizard will try to find or create a repository in the parent folder hierarchy of the selected projects.
Typically, newly created projects are located in the Eclipse workspace, thus repositories created this way would also end up in the Eclipse workspace.
This is not recommended for several reasons explained in the EGit user guide.
So, after some research, my logical conclusion is to create a Git bare repository and then link it to the project located in the workspace... wrong! bare repositories are not available to a Eclipse project.
I need a serious explanation on this.
Seems that I went wrong about what I thought was a contradiction in the EGit User Guide and the EGit behaviour about moving the project directory to the Git repository.
When the project files are moved as a working directory of the Git repository (with a Git metadata folder at the same level), they're still under the Eclipse control, as Eclipse workspace. But as EGit User Guide says (http://wiki.eclipse.org/EGit/User_Guide#Eclipse_Workspace_and_Repository_working_directory), the .git metadata folder should NOT be into the workspace... well that's when I was wrong, cause it is a Eclipse project/Git working folder... but it IS NOT an Eclipse workspace by any means, so the Git metadata folder is not editable, as any other source project file, just for Git (and the EGit Eclipse plugin, of course).

Eclipse subversion chan't checkout existing project

I had a working kepler eclipse on Ubuntu 13.04, x86_64.
Subversion svn, version 1.7.8.
I had several projects in my workspace.
The actual storage was set up on disk as:
top:
ProjA
ProjB
ProjC
where the different projects where checked out of the subversion repository separately, even though "top" was in the repository, as was top/ProjA, top/ProjB, etc.
I then moved the whole mess to a backup directory and checked out the repository fresh so that each of the project directories were proper subversion subdirectories under top, which is now checked out as a proper subversion directory.
I then copied in the .metadata, .settings, and .project files & directories into the new structure and started eclipse. I get the following message:
SVN: '0x00000000: Open Project' operation finished with error: 0x00000000: Unable connect to 'perl' project.
Please check that SVN meta-information exists and its format is supported by the current SVN plug-in version.
If so, it is possible that project working copy is relocated outside plug-in control.
At the current moment project will be automatically disconnected from source control.
0x00000000: Unable connect to 'perl' project.
Please check that SVN meta-information exists and its format is supported by the current SVN plug-in version.
If so, it is possible that project working copy is relocated outside plug-in control.
At the current moment project will be automatically disconnected from source control.
Which is expected, because the old directory structure had the svn info in each of the project directories, and now it's located higher up in the tree.
However, when I try to reconnect the project (right-click project, Team->Share Project) to the repository, the Share Project Wizard correctly finds the repository path, selects Simple Mode to connect to the correct URL, but I get the message:
Share Project
The Project "perl" already exists in repository and has some content.
To connect the local project to the specified location, the repository
folder content should be checked out. Please consider that applying
local changes can cause resource conflicts..."
Do you wish to proceed?
I click "Yes", and get:
Share project was failed.
svn: E200030: CANTOPEN
Any idea on how to proceed?
Configuration:
Team SVN Connector: SVNKit 1.7.9
Subversion svn, version 1.7.8.
I have this kind of problem. In my case, it seems projects are disconnected if there are some latency to access the file (eg network).
After some investigations, the subversive plugin is no more a production tool, and is no more supported....

How to isolate Eclipse workspace from git local repository?

I installed EGit on Juno and created a Java project in workspace of Eclipse. Then I shared that project to Git. Then when I check the project's properties, I found that the project had been moved from its original workspace into Git local repository. When I make some changes in Eclipse editor, the changes are made on the local repository without commit.
How to isolate Eclipse workspace from git local repository?
(Well, my Eclipse workspace is ~/Documents/workspace, my git local repository is ~/git/myrepository1. )
The workspace is still in its original location outside of edit. It's the projects that have been moved into the git-controlled directories. Normally projects are created in the Eclipse workspace folder but you can override that default.
If you really want to isolate changes from git, you'll have to break git's control of the project, but you may still have to move the project contents back into your workspace. Unfortunately, the process of getting further changes back into git gets really messy.
I've found it unnerving at first the way git controls my eclipse projects, but after a while it does begin to make sense and is really a very powerful version control function.

Eclipse not allowing svn compare and giving resource not existing in repo error

I am using team svn plugin in my eclipse helios pydev project.I deleted a repository file in eclipse and then committed the changes and all went well. The file got removed from repository fine.
Lets say package structure is like this in repo
dev/
folderA/
folderB/
C.py
In eclipse dev is the project name.
I deleted C.py from eclipse and commited using svn team commit option.
It worked fine.
Now when I try to compare folderA with repo folderA, Eclipse try to compare C.py from the revision which obviously is not there and does not allow compare to work.
Somehow eclipse has that file in its memory.
How can I make eclipse know that file is deleted and is not supposed to be there in first place?
it seems that was just a synchronisation problem as after updating from the repo the problem was solved.

Associating existing Eclipse project with existing SVN repository

I have an eclipse project on my hard disk, which is a fairly recent check out from an SVN repository. I've imported this project into my Eclipse workspace, and now want to associate it with the SVN repository.
How do I do this? The only options I seem to have under Right-click -> Team is "Share Project", which only seems to allow me to do an initial import.
Edit: Motivation - It's a largish repository, and I don't really want to have to import the whole thing over the network.
Edit 2: There are (for some reason) no .svn dirs in the project. So maybe a fresh import from svn is the only option
Team->Share project is exactly what you need to do. Select SVN from the list, then click "Next". Subclipse will notice the presence of .svn directories that will ask you to confirm that the information is correct, and associate the project with subclipse.
I just wanted to add that if you don't see Team -> Share project, it's likely you have to remove the project from the workspace before importing it back in. This is what happened to me, and I had to remove and readd it to the workspace for it to fix itself. (This happened when moving from dramatically different Eclipse versions + plugins using the same workspace.)
subclipse not showing "share project" option on project context menu in eclipse
I'm asked this question very frequently, if it's smart to use "Share project..." if a eclipse project has been disconnected from it SVN counterpart in the repository. So, I append my answer to this thread.
The SVN-Team option "Share project ..." is totally fine for projects that exist in SVN and in your Eclipse workspace, even if the Eclipse project is missing the hidden .svn configuration. You can still connect them. Eclipse SVN-implementation (Subclipse/Subversive) will verify if the provided SVN http(s) source is populated. If yes, all existing files will be copied and linked (checked out in SVN terms) to your very personal Eclipse workspace.
Word of caution:
Do a backup if you depend on you local files. The SVN implementation may vary its behaviour with every release.
If you have multiple projects encapsulated within each other, make sure you point the SVN path to the correct local path.
regards,
Feder
I came across the same issue. I checked out using Tortoise client and then tried to import the projects in Eclipse using import wizard. Eclipse did not recognize the svn location. I tried share option as mentioned in the above posts and it tried to commit these projects into SVN. But my issue was a version mismatch. I selected svn 1.8 version in eclipse (I was using 1.7 in eclipse and 1.8.8 in tortoise) and then re imported the projects. It resolved with no issues.
I am using Tortoise SVN client. You can alternativley check out the required project from SVN in some folder. You can see a .SVN folder inside the project. Copy the .SVN folder into the workspace folder. Now remove the project from eclipse and import the same again into eclipse. You can see now the project is now associated with svn
In case of SVN servers you have to creating a central repository with all projects. The contents of the repository can be uploaded with the Team/Share command; in case of the Subversive client it automatically runs a commit after the import, so you can upload your files.
This step cannot be circumvented in any way using a centralized version management system such as SVN.
Try this- Close the project then open it. It links with svn automatically,if project was checked out from valid svn path.