Can't pull a Gradle project in Eclipse - eclipse

I'm part of a team working on a game project and we just moved our project to using Gradle. I can pull, commit, merge and push normally with Git GUI in Windows Explorer, but other members of the team can also pull in Eclipse by right-clicking the Gradle-project folder in Project Explorer view, choosing Team-menu and then Pull. However, in my Eclipse the "Team" settings only give me options to "Apply Patch" and "Share Project.." the whole team has tried to find a solution for this to no avail so far.
Before the project was built on Gradle, I was also able to pull in Eclipse by using the aforementioned method. We're using Git repository.
Any suggestions on where to look for the cause of this malfunction?
Thank you.

I assume then you don't store the Eclipse project files/settings in your Git repository but create them locally using gradle eclipse.
Then after importing the project into Eclipse (be sure not to copy it to the workspace) you can use the Share project... option under Team in the context menu. Then choose Git. Eclipse EGit will automatically detect if your project resides in an existing repository (it should be listed on the next wizard page) and set up the corresponding association.
The term Share project maybe is a bit confusing, as you also do it for projects that already are under version control.

Related

Exporting project to Git in Eclipse vs IntelliJ

I am new to Git and was exploring the Git integration in Eclipse, IntelliJ, and Pycharm. In Eclipse, the way projects get exported seems to be that the project gets added to an existing repo, while in IntelliJ and PyCharm, the project's root directory itself becomes a Git repo. This approach made the most sense to me, but then again I don't have much experience in sharing code. This latter approach is also possible in Eclipse by clicking the "Use or create repository in parent folder of project" checkbox, but when I did so, Eclipse told me that using the parent folder was not recommended.
Now for my question: Why does Eclipse warn against doing precisely what JetBrains IDE's do by default? What are the dangers in using a project's parent folder as a Git repo?
I read online that it has to do with the fact that once the parent folder is created as a repo, you can't add any new projects to the repo. But what are the benefits of adding projects to existing repos vs just making a separate repo for each project to keep everything separate?

How to check out multiple maven projects from remote git repository

after a couple of hours trying and reading a number of tutorials, I can't fix the following problem: I have a remote server running a git repository. From eclipse (neon.2 and egit) I pushed several maven projects, each with its own pom.xml to this repository. When a friend of mine, who wants to co-develop tries to setup his environment, also using Eclipse Neon.2 and egit, we are not able to reproduce the setup in the Package Explorer. We get all the sources but in one project. The original maven projects are all nested in this one project. This wrong setup results in a couple of problems when trying to compile or run the projects.
We used File-> Import-> Git-> Projects from Git-> Clone URI. In Source Git Repository we pointed the Repository path to /home/git/workspace.git. In the Branch Selection dialog we can then only see the master. In the following Local Destination dialog we checked the Clone submodules checkbox. We played around with the following options to run wizards which were all failing, so we ended up with this one project option in the bottom of the three options in the dialog.
What is not happening, is the import projects dialog as explained here https://wiki.eclipse.org/EGit/User_Guide/Remote#Import_Projects
(but this seems to be a former version, since the Clone submodules checkbox is missing in the dialog before on this web page)
Can anybody please tell us how to extract the maven projects as top elements in eclipse, linked to the existing git repository, such that we can work as a team?
Should you need any additional information, please let me know.
Thank you in advance.
I would advise you to always put all Eclipse configuration files to the repository when creating projects. What you should do is add all necessary maven integration related files to the repository (.project, .classpath, .settings/*m2e.core.prefs or better yet entire .settings). If you have done so, you are fine. If not, add them and pull changes on your colleague's machine.
On target machine remove the project from workspace, but do not delete contents. In Eclipse Git repositories view select your repository and expand to see Working tree. Right click it and select Import projects. This will trigger the flow you pointed our at Eclipse wiki. From there it should be straightforward - Eclipse will try to detect projects and will import them, so that they have Maven nature and are managed by EGit.
If you don't want to or cannot share maven configuration in the repository, have a look at this answer which tries to describe how to achieve that without Eclipse configuration files.

no commit button in Team menu in eclipse when checking out project from github

I create a local maven project in eclipse. I share the project on github remote repository. and the Team menu comes to have a list of buttons like commit, revert etc. Just like using svn.
Now I checked out the same project from the same remote repository on another machine. The project was checked out successfully but the Team menu has only Share button. Eclipse dose not recognize it is checked out from a scm.
What to do to make eclipse has the list of buttons in Team menu when checking out a git project?
Chances are, you have not installed the egit plugin on the second machine, therefore Eclipse doesn't know anything about git repositories.

Using mercurial in eclipse with linked source

I have an android project in my eclipse workspace. However, it uses source imported from another location - I dragged the folder onto the project and selected "Link to files and folders". The sources itself exists in a mercurial repo but the project does not. How can I get eclipse to give me a team menu for mercurial sources, is it possible? (I have installed MercurialEclipse plugin) The only thing I can see it offers me is when I right click the project to create a new mercurial repo which is not what I want.
Thanks in advance
Stephen
The normal solution would be to reference your second set of source as a subrepo.
But since May 2010, issue 11871 shows that subrepos aren't properly recognized by the MercurialEclipse plugin.
Its target resolution is for MercurialEclipse1.9. We are currently at MercurialEclipse1.7.1.
So the other solution would be to make a separate project, referencing directly (and only) your second set of sources, and setup a "project dependency" between your first project and your second Eclipse project.
That second project would include a second Mercurial repo and could be shared easily with MercurialEclipse.

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.