Using a separated source folder from SVN on Eclipse - eclipse

So, here in the company we work with svn, and our svn server only have the source folder. When I use NetBeans, it's everything ok because I can add source folders in project and will work fine in svn. But on eclipse if i do the checkout from command line and add that folder in my dynamic web project, I can't see the svn history and nothing, svnclipse just does not work on that folder.
Our structure of the projects it's something like this
Workspace
Project folder
Project1
Project configuration files
SourceCode
Packages
Project folder 2
Project2
SourceCode
I already try to make checkout using svnclipse, but he add alot of extra config files, he turns the folder in a project and the source folder is add as a link to another project, in this scenario the svnclipse quick diff does not work properly.
There is a way to use that folder as source and Svnclipse works on that ?
Sorry if my English is not so good

There is no easy way to do what you want. In Eclipse a source control provider can only be connected to the project itself. So options are:
Use another svn client like command line or TortoiseSVN.
Create a small SVN project with the Eclipse project configuration files that also use svn:externals to pull in your source folder from repository.
With option 2, you would checkout this small SVN project from some other repository using Subclipse in Eclipse, could even be a local file:// repository and then the svn:externals property would also cause your source folder to be checked out.

Related

How can I create a project in the Git repository root using Eclipse EGit?

I would like to add the project files of a brand-new Eclipse project to the root-level of a git repo. I would like it to look like something like this:
./projectrepo/.git
./projectrepo/.project
./projectrepo/src
...
However, the Eclipse Egit wizard provides no obvious way to do that, and insists on creating an undesired subdirectory (screenshots below):
./projectrepo/project/.git
./projectrepo/project/.project
./projectrepo/project/src
...
How can I get Eclipse to add my files at the repository root?
I understand that the Egit manual advises against this, but I do not plan to ever have multiple projects in this repository, so the extra directory is unnecessary (and counts against filesystem path limits on Windows). The fact that it's advised against tells me it must be possible somehow (or the documentation's wrong).
System information:
Windows 7 64-bit
Eclipse Oxygen Java EE (4.7.0 Build id: 20170620-1800)
Eclipse EGit 4.8.0.201706111038-r
Screenshots of Eclipse's current undesired behavior
Configure Git Repository wizard. Most of the things I'd like to change, like Target Location, are uneditable. Path within repository can only be used to add more extra folders. Use or create repository in parent folder of project has a freetext repository path input, but only parent folders will validate and can be used.
Resulting undesired Git repository structure. I would like my project files to be in this directory, not an extra "TestProject" folder:
Try instead to:
import your project into your Eclipse workspace
then use Team/Share project: it should detect the Git repo in it.
That way, you should avoid the double-folder creation.

Commit Folder From Local Directory to Online Using SVN

I'm completely new to subversion and I'm unsure how to add and commit a Java Project to an online repository using svn. The goal is to move the important folders in the project including the src, package, and class. I've accessed the online repo and I (assume) I have it as a working copy. When I try to svn add the local project folders however, I am told it is not a working copy. How do I fix this? Is there a way I can make my workspace be the online repo directly? Or do I just copy the folder somehow? I'm using Cygwin and Eclipse.
To add your project to svn you can do it this way:
Right click on your project and select: Team / Share Project...
Select SVN
Select Use Existing Repository Location
Browse to the location you would like your project to reside: typically .../trunk
Click OK and finish
This should have committed your project to SVN. Regarding your question about your entire workspace being the online repo. with each of your individual projects connected to SVN just like I detailed above, you will be able to commit and update your local projects into and from SVN without any issues.

Import existing mult-rep CVS project folder into Eclipse

I wish to import an existing CVS managed project into Eclipse. I am currently trying to shift my work on to the Eclipse IDE. Some details about my project and environment below.
I'm working in Linux Ubuntu, the project folder is located on a mounted shared network drive, I have installed the "Eclipse CVS Client" plug-in for my version of Eclipse (Helios).
I've tried many ways for eclipse to use my existing folder as a project and recognize the CVS data in the CVS folders.
I have done the following options:
Created a new project, selected existing source, located my project folder and clicked OK to finish creating. In the end the CVS files weren't automatically read.
Did the same as above and after project creation I wen to the option "project menu->team->share project", it asks me to choose a repository and doesn't automatically find the CVS information in the subfolders.
I have set-up both repositories in my eclipse and can browse the repositories through the CVS browser.
My project directory layout is like this:
+-Project Folder (no CVS folder at this level)
+---Repo A folder
+-----CVS meta-info folder is INSIDE, along with all checked out files from Repo A
+
+---Repo B folder
+-----CVS meta-info folder is INSIDE, along with all checked out files from Repo B
+
+-(couple of random files, not in CVS)
Just right-click on your project and click Team -> Share Project. Eclipse will detect that the folder is already shared and resolve the connection with CVS.
Actually I cannot answer your question (I think it should work as you explaned) but I might have a workaround. Could you remove or rename the existing folder and do a fresh check out from your eclipse/CVS repository exploring view?

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.

Eclipse "Share Project" by hand?

What actually happens to the file system when you do a Subclipse Share Project on an Eclipse project that was externally checked out from Subversion? All the .svn folders are already in place. I get an error when I try to Share Project the right way, and I'd rather not delete and re-checkout the projects from the SVN Repository browser.
Dunno exactly what happens within eclipse, I presume it does some funky stuff in the .metadata directory of the workspace. That said, I would recommend the following to get eclipse to learn about the svn settings of the project:
Delete the project from the workspace (keep "Delete project contents on disk" unchecked)
File > Import... > General > Existing Projects into Workspace
Browse to the folder containing the original project(s) of interest
Import the projects into your workspace
This seems to have the side effect of subclipse noticing the subversion settings when importing the "new" projects into your workspace.
The Share Project action is intended to commit the first version of a project, i.e. one with no .svn metadata in place. It will get upset if it sees .svn directories already there. As Rob wrote, the way to get that checked-out project into Eclipse is to use the import capability.
I'm not sure what version of Eclipse you are using or whether this will apply since I'm using Subversive instead of Subclipse. When I use the share project feature to commit the project into svn when I already have all of the .svn directories in place, I get a choice of like "Use current project settings" and then eclipse automatically reattaches the project svn information to the team integration. You can screw it up if you try to enter different information.