Eclipse Hadoop源码阅读环境

一、解压hadoop src包到workspace目录。为加快下载jar包的速度,在eclipse的maven设置里将配置文件的路径设置正确,然后配置maven的settings.xml:
<mirrors>
<mirror>
<id>nexus-maven</id>
<mirrorOf>*</mirrorOf>
<name>Nexus maven</name>
<url>http://repo1.maven.org/maven2/</url>
</mirror>
<mirror>
<id>nexus-sonatype</id>
<mirrorOf>*</mirrorOf>
<name>Nexus sonatype</name>
<url>http://repository.sonatype.org/content/groups/public/</url>
</mirror>
<mirror>
<id>nexus-jboss</id>
<mirrorOf>*</mirrorOf>
<name>Nexus jboss</name>
<url>http://repository.jboss.com/maven2/</url>
</mirror>
</mirrors>
二、File->Import->Existing Maven Projects,在Root Directory处选择解压好的目录,Finish
三、等待maven把依赖包下载好后,会出现一些问题,下面是重头戏。
四、maven问题解决
(1)若发现maven依赖包找不见,找到位置后删除jar包目录,然后右击工程,Alt+F5,确认后会自动下载。不要手动下载第三方包,可能不识别。若有lastUpdated文件,说明下载失败,也得删掉
(2)报 maven-resources-plugin prior to 2.4 is not supported by m2e
修改最顶层的pom.xml文件
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.5</version>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
或者快速修复
(3)报Plugin execution not covered by lifecycle configuration
Windiow > Preferences > Maven > Errors/Warnings > Plugin executiuon not covered by lifecycle configuration. 选择Ignore。
或者快速修复,Permanent Mark goal as ignored in Eclipse build in Eclipse preferences
(4)报Missing artifact jdk.tools:jdk.tools:jar:1.6
修改最顶层的pom.xml文件
<dependency>
<groupId>jdk.tools</groupId>
<artifactId>jdk.tools</artifactId>
<version>1.6</version>
<scope>system</scope>
<systemPath>${JAVA_HOME}/lib/tools.jar</systemPath>
</dependency>
 
为使修改在所有project上生效,需要右击工程,然后Maven->update project
 
简单而有效,是我的一贯作用,喜欢看长篇大论的可以出门右转。
posted @ 2016-09-30 11:21  码以致用  阅读(604)  评论(0编辑  收藏  举报