GitHub import Maven project to eclipse

Source: Internet
Author: User

For Java projects, most of what you see on GitHub is built on Maven, and many are now switching to gradle, such as Hibernate and spring. Recently want to study some open source projects, but after the clone import eclipse, found that the source package is a normal file display, so that the class can not jump directly between the source code to look very laborious, as shown in the following figure:


The reason for this is that the GitHub Maven project typically does not place local profiles into a version library for structure clarity and does not rely on specific Ides. This way, when you import eclipse, you cannot be identified as a regular project because you do not have a. Classpath,.project, the solution is as follows:

Method one, using MAVEN to build Eclipse projects

MVN Eclipse:eclipse
It is convenient to use the above command to import the generated artifacts into eclipse.

Method Two, add and modify. classpath and. Project files

In the beginning I used this way, later found too cumbersome to give up use, you can refer to from the GitHub Maven project to import Eclipse4.2.


Digression: Why open source projects are not built with the IDE.

Generally speaking, a more formal project is not built on the IDE, but rather ant,maven,gradle.

Why not use the IDE?

One, about the choice of the IDE, radish greens each of their own strokes. Some people like eclipse, some people like myeclipse, cows are useful vim, so for a project, especially the public project, the adoption of a specific IDE limits the choice of open source users, reduce the passion of developers. In fact, the various Ides are also based on a variety of build systems, different Ides, and they are built differently, so for different Ides to develop together, you need a unified build tool. Pull to the build tool, General/C + + project with make, or premake. And Java is generally ant,ivy,gradle,maven, there is a direct shell, is not a lot have not heard of it? To see open source project is the time of insight ...

Maven,gradle provides the ability to convert a project to a specific IDE, such as MVN eclipse:eclipse, so that users can choose the IDE they like, quick and easy ...

Second, build tools like Maven,gradle provide the jar's dependency management so that you can save a lot of space when uploading to GitHub without uploading jar packs. For the free 300M space provided by GitHub still need to save the use of ...

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.