(Transfer) General steps for importing open source projects into eclipse

After downloading to the open source project, we still hope to import it into eclipse and see it, so it is more convenient. The general steps are as follows

 

Open the source code directory,

  • If you see a .calsspath .project file in it, it means that the project was originally developed by eclipse, then in eclipse -> file -> import -> existing project
  • If you see that you have build.xml , it means that this project is built by ant, refer to the following "About importing ant project"
  • If you see a pom.xml file in it, it means that the project is built by Maven, refer to the following "About importing Maven projects"
  • For others, create a new project and import the source code

 

 

About importing ant projects

This is relatively simple, open eclipse, file->new->project (yes, you read that right, it is new, not imported)

Select "Create a java project from an existing ant build file", then the next step, take a project name, and specify the location of the build.xml mentioned above.

 

 

 

 

About importing Maven projects

Maven is a build tool that can be imagined like make, clearmake, ant

First you have to install Java, then:

1. Download

  Go here http://maven.apache.org/ to download the compressed package and extract it to a directory

2. Configure environment variables

  Open the environment variable settings and add the installation location of Maven to the path. For example, my path is:

  C:\jdk1.8.0\bin\;C:\Program Files (x86)\apache-maven-3.2.1\bin

Then open a new cmd and enter mvn -v to see the version information and it's OK

3,Maven安装好以后,到源代码目录,打开cmd,输入mvn eclipse:eclipse,回车,这个时候,maven会将该目录下的mvn项目转换为eclipse项目(转换完成后,你会发现项目目录下多了.calsspath .project文件),这个时候你就可以回到上面所说的第一种情况,直接导入了。

 

另外,maven还有一个eclipse插件,可以在eclipse的帮助菜单下点击Eclipse Marketplace, 在市场中搜索安装

 

然后导入mvn项目时就可以用图形界面导入了

 

转自:http://www.cnblogs.com/zhouyinhui/p/3772785.html

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326984036&siteId=291194637