我用的環境(錯誤跟環境不要緊):centos6.4,hadoop2.6.4(或者hadoop2.7.6或者hadoop2.6.5)java
【錯誤1】:mvn clean install -DskipTests中遇到:linux
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile (default-compile) on project hadoop-minikdc: Compilation failure: Compilation failure:
[ERROR] error: error reading /root/.m2/repository/org/apache/directoryrver/apacheds-interceptor-kerberos/2.0.0-M15/apacheds-interceptor-kerberos-2.0.0-M15.jar; error in opening zip file
[ERROR] error: error reading /root/.m2/repository/org/apache/directoryrver/apacheds-interceptors-collective/2.0.0-M15/apacheds-interceptors-collective-2.0.0-M15.jar; error in opening zip fileapache
截圖:centos
錯誤緣由:下載的jar包有問題(可能不完整),因此報「error in opening zip file」tomcat
解決辦法:從本機講對應的jar包下載來,覆蓋linux上maven庫中有問題的jar包。app
【錯誤2】:執行mvn package -Pdist,native -DskipTests -Dtar這一步的時候報報錯:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.7:run (dist) on project hadoop-kms: An Ant BuildException has occured: exec returned: 2
[ERROR] around Ant part ...<exec dir="/home/hadoop/apps/hadoop2.6.4/hadoop-common-project/hadoop-kms/target" executable="sh" failonerror="true">... @ 10:120 in /home/hadoop/apps/hadoop2.6.4/hadoop-common-project/hadoop-kms/target/antrunbuild-main.xml
截圖:maven
解決辦法:oop
首先使用java -version查看版本號是否跟本身安裝的版本號一致,若是不一致,那麼執行命令ll /usr/bin/java檢查指向,具體修改方法自行搜索;ui
若是java -version看到的版本號正常,那麼進行下面的操做:spa
查看 hadoop-common-project/hadoop-kms/target/antrun/build-main.xml 文件中使用的apache-tomcat版本號,並下載(文件中有地址),而後放到目錄 hadoop2.6.4/hadoop-common-project/hadoop-kms/downloads下
找downloads目錄方法:
build-main.xml配置文件中有:
<echo file="/home/hadoop/apps/hadoop2.6.4/hadoop-common-project/hadoop-kms/target/tomcat-untar.sh">cd "/home/hadoop/apps/hadoop2.6.4/hadoop-common-project/hadoop-kms/target/tomcat.exp"gzip -cd ../../downloads/apache-tomcat-6.0.41.tar.gz | tar xf -</echo>
其中的../../downloads/apache-tomcat-6.0.41.tar.gz就是該放的目錄,../../是相對於tomcat-untar.sh來講的,因此downloads目錄應該是:/home/hadoop/apps/hadoop2.6.4/hadoop-common-project/hadoop-kms