Importing a Maven project into Eclipse from Git

前端 未结 14 1623
误落风尘
误落风尘 2020-12-02 06:04

How can I get the effect of choosing to import from both Maven and Git and have Eclipse properly generate my project?

To get my project into Eclipse I can choose Fi

14条回答
  •  余生分开走
    2020-12-02 06:45

    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.

    1. 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.
    2. 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.

提交回复
热议问题