4

I know this is a relatively special question. Maybe some knows this nevertheless:

I want to compile Hector with Maven in Eclipse=> Branch: 0.7.0 and Tag: hector-0.7.0-29 (https://github.com/rantav/hector.git). (The mentionaed Branch/Tag are not(!) the Master Branch, so requires a dedicated Checkout.)

I have installed: Maven-Maven Plugin and the EGit Plugin for Eclipse

My Problem:

1.)Maven Plugin allows to checkout directoly from a SCM like GitHub (when installing the maven-git-plugin= this is not the same as egit plugin). I am now able to downlaod a Project directly from Github with the maven plugin. On Disk I find the Tag and Branch (as Git files in the .git Directory.)

But the Problem is, the Version that is checkout out is the MASTER Branch. And I do not find an option to checkout the specific Branch and Tag directly within Eclipse. When clicking on "Team-Context-Menu" I normally have all the EGit Options (to checkout a specific Branch/Tag). But due to the fact the Project got downladed via the Maven Plugin it seems it is not regarded from Eclipse as an Git Repository.) So klicking on "Team" where I normally have all my Git-Commoands is more or less empty. I need to find a way to tell Eclipse that this Project is a GIT/EGIT managable project, so that I have the menu options to manage it.

2.) Furthermore I want the downloaded Project to be completely "SCM-Managed" (via Git) so that I can "track" my local changes to the files. Therefore all "Egit Context Menu" Stuff should be working for this checked out project.

If someone knows how to do this, I would be very kind for any advice!

Thank you very much! Jens

jens
  • 16,455
  • 4
  • 21
  • 20
  • Don't you have the menu entry "Share" under Team? – dunni May 16 '11 at 19:33
  • 3
    oh well, I spend half a day trying to solve this problem (I am new to git/maven). The solution is dead simple, but not really intuitive for beginners. If you know what to do its as simple as: 1.) As described above, download the project wit the maven plugin from GitHub 2.) Open "Repository View" and add the checked out project as a "Local REpository" 3.) Click in the project Context menu on "Team => Share Project" and run through the witzar, then everything works. – jens May 16 '11 at 20:38
  • (I can not answer my own question as newly registered user, therefore the solution as comment) – jens May 16 '11 at 20:40

2 Answers2

4

Well, the simpler answer would just be to clone the repository with EGit, right click on the repository in the repositories view and select "Import Projects".

dunni
  • 43,386
  • 10
  • 104
  • 99
  • For all readers: Pls see also my comment above, ther are two solutions. – jens May 16 '11 at 22:26
  • 1
    This doesn't work for me. I get a dialog saying "select a wizard to import project". "Import existing projects" is not an option since there is no .project committed in maven. The last option is also not valid since the project won't be a maven project. The only acceptable option is "Use the new project wizard". After that, in the new wizard i select "checkout maven project from SCM". then the SCM URL should be what? the remote url or the local, cloned repo path?i tried both and they do import the projects into eclipse but they still are not linked to the git repo, which was the orgnal problem – Hilikus Dec 23 '12 at 00:05
  • Not a complete answer for Maven projects, requires further manual steps & hacking the project/ build nature up to get it work. Perhaps a better answer here: http://stackoverflow.com/a/7269917/768795 – Thomas W Apr 26 '15 at 01:11
0

I had a similar problem with a repository already cloned, but new projects were on a new branch. I switched to the desired branch and used "Team" -> "Show in Repositories View" -> "Working Directory" -> "Import Maven Projects..." on the desired projects.

mabi
  • 522
  • 1
  • 6
  • 20