instead of constantly generating project metadata via import->maven command, you can generate your project metadata once and the place it in your git repository along with the rest of your source code. after than, using import->git command will import a proper maven-enabled project, assuming you have maven tools installed.
make sure to place into the source control system all files in project dir that start with '.' such as .classpath and .project along with the entire contents of the .settings directory.
i would prefer to import projects into eclipse as
maven projects rather than
git project. doing this will still allow the project contents to be recognized as git contents. you can continue to perform git operations from eclipse. as you have mentioned the reverse is not true.
the nature of a project in eclipse is not based on the scm which holds the project, but on the type of project - whether war or jar, etc. - which is automagically determined when the project is imported as maven project.
i would be hesitant to check-in to scm ide-specific metadata. doing so assumes a lot of things - all developers are using the same ide or version of the ide, perhaps same version of jdk/jre, that they continue to use the same version throughout the project lifecycle and so on.
can't you import it as a git project and then (if you have the m2eclipse installed) right click on the project in the package explorer >
enable dependency management?
after checking out my branch in egit, i switched to the java view, then used file-->import, git-->projects from git, then selected the top level maven directory. this was with eclipse kepler.
i have a maven project with three submodules that is managed in git. i set them up in eclipse as follows:
- i registered the git repository with eclipse using egit
- i imported the projects as existing maven projects
- for each project, i went team | share project.
direct answer: go to files>>import>>git>>project from git (you should have git installed on eclips)
you should note that putting generated metadata under version control (let it be git or any other scm), is not a very good idea if there are more than one developer working on the codebase. two developers may have a totally different project or classpath setup. just as a heads up in case you intends to share the code at some time...
import without installing any additional connectors for mylyn:
git repositoriesview (window->show view->git repositories)
clone a git repositorybutton and proceed with all steps
- in newly created repository expand
working directory, right click on folder with your project and select
import projects. then either choose
import existing projects, or select
import as general project. if needed after importing right click on your project and select configure->convert to maven project (and maven->update project).
here's my workaround, this is a solution to these issues:
- you can't install m2e-egit (i get an error in juno)
- converting a general project (connected to your git repository) to a maven project isn't working for you (the import maven projects step seems essential)
- importing maven projects from your repository on the filesystem isn't showing the project connected to git.
- setup your git repository in the git repository exploring perspective.
- switch to the java perspective, import > existing maven projects
- browse to your git checkout in the filesystem, select the directory containing the pom.xml file. finish the import; you'll notice these projects aren't connected to git. :-(
- delete these projects, but do not delete from filesystem. we don't want our clone deleted; this task also leaves the .project file behind so that we can import in the next step.
- go back to the git repository exploring perspective.
- right-click your repository, import projects...
- select import existing projects
- in the explorer below, browse to and select the directory containing the pom.xml (and .project file) , then click next.
- continue through the wizard.
i have been testing this out for my project.
- eclispe indigo
- "help > install new software" enable/install official git plug-ins at "eclipse git plugin .." and install the lot.
- enable the maven/egit connector with these instructions how do you get git integration working with m2eclipse?
- switch to the git repository perspective. right click paste the project git url. the defaults should all work. you may want to change the install folder it guesses.
- expand the cloned repository and right click on "working tree" and pick "import maven projects...".
- switch to the java perspective. right click on the project and choose "team > share project". select "git" and be sure to tick the box "use or create repository in parent folder of project".
as of this (updated) writing, a working setup is the following:
- eclipse 3.8 (eclipse indigo update site)
- egit 1.3.0 (eclipse indigo update site)
- m2e 1.0.200 (eclipse indigo update site)
- m2e-egit 0.14.0 (m2e marketplace when adding a connector)
tested on ubuntu raring.
you can certainly "import" -> "maven" -> "check out maven projects from scm", and this is the quickest way. however, such direct import currently does not give you control over the cloned repository folder name. you may be better off working from the "git repository" view and perform either a "clone from a git repository and add the clone to this view", followed by an "import maven projects" from such clone; the longest way would be to do your manual cloning and then "add an existing local git repository to this view", followed again by an "import maven projects". either case you have full control on the cloned folder.
a final comment on a side issue that made me cry in frustration. as far as i know, if the cloned repository lies on the root of your eclipse workspace, and your maven project file hierarchy has a pom on its root, then importing such root project will rename the cloned folder (with the template you chose, defaults to [artifactid]). without changing your project structure and without keeping files outside your workspace, you can easily work around this issue by cloning on a subsubfolder of the workspace folder.
step 1 : setting up eclipse
first of all you'll need to have a few eclipse plug-ins installed. so use eclipse ide software install feature in the help dropdown menu → install new software, and add link to available software site, then install it.
- git plugin (egit)- http://download.eclipse.org/egit/updates
- eclipse maven plugin (m2eclipse) - http://download.eclipse.org/technology/m2e/releases
- maven scm handler for egit (m2e-egit)
install from the m2e marketplace (settings → maven → discovery → open catalog and search for " m2e-egit")
step 2 : clone the repository
clone(download) your maven projects from git
check out non-eclipse maven projects from git (file → import.. → maven → check out maven projects from scm)
now add your git repository link to scm uri field.then click next & finish.
i would perform a git clone via the command line (outside eclipse) then use file -> import... -> existing maven projects.
your projects will be understood as using git and maven. it's the fastest and most reliable way to import imo.
eclipse indigo + m2eclipse 1.0 makes it very easy.
if you don't already have the git connector for m2eclipse install it. m2eclipse will help you along by prompting you on the import menu.
- select the "import..." context menu from the package explorer view
- select "check out maven projects from scm" option under the maven category
- on the window that is presented choose the link "find more scm connectors in the m2e marketplace
- find connector for git...install...restart
note that in the search box you may have to enter "egit" instead of "git" to find the right connector.
with that done, simply go to the egit repository, bring up the context menu for the working directory and select "import maven projects...".
- Importing a Maven project into Eclipse from Git
- Importing multiple maven projects from git into eclipse
- Importing multimodule maven project from Git into Eclipse/STS
- Importing Maven project into Eclipse
- Maven root pom.xml marked as red when importing existing project into eclipse
- Importing an existing maven Project into Eclipse
- Importing a Scala project from github into Eclipse
- m2eclipse: add group id to project name when importing existing maven project into Eclipse
- eclipse source folder is not java project, after importing project from git
- pom.xml greyed out when importing maven project into eclipse
- How do I import a multi module Maven project from SVN into Eclipse (Indigo) so that child modules can be built independently?
- Disabling the Maven project builder when importing projects into eclipse
- Maven Java web project not recognised when importing into Eclipse
- What do I need for autocomplete and ctrl+click to work in eclipse after importing a project from Perforce and converting it to a maven project?
- Maven project imported to eclipse from git is missing "Maven Dependencies" library
- Issue Importing Maven (Atlassian JIRA Plugin) Project into Eclipse IDE
- Loading an Android project from git into Eclipse
- Java code for Importing git project from local in Eclipse
- Trouble when importing a maven project into eclipse kepler (swagger for jersey rest)
- Errors after importing Maven project into Eclipse
- How to run Maven project in Eclipse by importing it from github
- importing library project + different projects into Android Studio from Eclipse
- What is the adviseable Git repository structure for a Maven Project to be used from Eclipse IDE
- Problems after Importing an android project from github into Eclipse
- How do i consolidate a bunch of projects from one git repo into a single folder In Eclipse Project viewer?
- Using maven to turn TwelveMonkeys from Git into a Eclipse java project?
- importing maven project from netbeans to eclipse
- Errors while importing Maven project into Eclipse
- Importing Android Project from Eclipse into Android Studio
- Trouble importing gradle project (LibGdx) in eclipse from git repo
More Query from same tag
- Geocoder forceclose
- Spring + Hessian on Tomcat
- Creating a Mule project in Eclipse
- Using a GWT + Maven project in Eclipse
- Eclipse out of memory when trying to launch Selendroid application
- How do I set properties on file creation using Subclipse
- How to install plugin to eclipse from repository
- How to setup a linux C++ project in Eclipse?
- Error launching first test application: Android Packaging Problem?
- Image not shown on Emulator/Device? Eclipse Android
- running an RMI server in command line and eclipse
- Java XULRunner error in Eclipse / SWT in Ubuntu
- How to remove trailing space behind multiline comment's asterisk in Eclipse autoformat
- Eclipse Organize Imports shortcut not working on Mac
- font awesome not showing from bootstrap theme and im using eclipse
- PyDev problem staring project
- java eclipse debugging error
- Problem with number of rows in a dataset
- Eclipse CDT error: "make: *** [src/test2.o] Error 127"
- Eclipse CDT with MinGW displays warnings as errors
- Editing JSP in eclipse breaks special characters?
- Quick fix for terminal rules in xtext
- Cannot make egit work with a server via ssh
- How to load dynamic data on a eclipse shell?
- Java slick2d moving an object every x seconds
- Spring runs fine on server but not main application
- In Eclipse link two dynamic web projects to another project working as a library
- CLOCK_MONOTONIC not found
- Yet another 'member declaration not found'
- Android eclipse - Button drawable issue