Maven-3.3.9 Install and Oozie-4.3.0 Compile

hackeruncle發表於2017-04-25
1.Java版本1.8
[root@sht-sgmhadoopdn-04 app]# java -version
java version "1.8.0_66"
Java(TM) SE Runtime Environment (build 1.8.0_66-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.66-b17, mixed mode)
[root@sht-sgmhadoopdn-04 app]# 

2.maven-3.3.9安裝
[root@sht-sgmhadoopdn-04 app]# wget
[root@sht-sgmhadoopdn-04 app]# tar -xzvf apache-maven-3.3.9-bin.tar.gz
[root@sht-sgmhadoopdn-04 app]# ln -s apache-maven-3.3.9 maven
[root@sht-sgmhadoopdn-04 app]# vi /etc/profile
M2_HOME=/root/learnproject/app/maven
PATH=$M2_HOME/bin:$PATH
[root@sht-sgmhadoopdn-04 app]# source /etc/profile
[root@sht-sgmhadoopdn-04 app]# mvn -version
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-11T00:41:47+08:00)
Maven home: /root/learnproject/app/maven
Java version: 1.7.0_67, vendor: Oracle Corporation
Java home: /usr/java/jdk1.7.0_67-cloudera/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "2.6.32-431.el6.x86_64", arch: "amd64", family: "unix"
[root@sht-sgmhadoopdn-04 app]# 

3.修改maven的倉庫設定
#這裡我們需要編譯oozie,所以不用阿里雲倉庫(很多依賴不全),改成使用maven的中央倉庫。
[root@sht-sgmhadoopdn-04 app]# cd /root/learnproject/app/maven/conf 
[root@sht-sgmhadoopdn-04 conf]# vi settings.xml

點選(此處)摺疊或開啟

  1. <mirror>
  2.     <id>Central</id>
  3.     <mirrorOf>*</mirrorOf>
  4.     <name>Central</name>
  5.     <url>http://central.maven.org/maven2/</url>
  6. </mirror>

  7. <!-- 阿里雲映象 -->
  8. <mirror>
  9.     <id>nexus-aliyun</id>
  10.     <mirrorOf>*</mirrorOf>
  11.     <name>Nexus aliyun</name>
  12.     <url>http://maven.aliyun.com/nexus/content/groups/public</url>
  13. </mirror>

4.oozie-4.3.0原始碼檔案下載解壓
[root@sht-sgmhadoopdn-04 app]# mkdir oozie_source
[root@sht-sgmhadoopdn-04 app]# cd oozie_source
[root@sht-sgmhadoopdn-04 oozie_source]# wget
[root@sht-sgmhadoopdn-04 oozie_source]# tar -xzvf oozie-4.3.0.tar.gz

5.修改pom.xml,改為1.8
[root@sht-sgmhadoopdn-04 oozie_source]# cd oozie-4.3.0
[root@sht-sgmhadoopdn-04 oozie_source]# vi pom.xml

點選(此處)摺疊或開啟

  1. <targetJavaVersion>1.8</targetJavaVersion>
  2. <sourceJavaVersion>1.8</sourceJavaVersion>
  3. <minJavaVersion>1.7</minJavaVersion>

6.第一次編譯
[root@sht-sgmhadoopdn-04 oozie_source]# bin/mkdistro.sh  -DskipTests -Puber -Phadoop-2 \
-Dhadoop.version=2.7.2 \
-Dhadoop.auth.version=2.7.2 \
-Ddistcp.version=2.7.2 \
-Dsqoop.version=1.4.3 \
-Dhive.version=1.2.0 \
-Dhbase.version=0.94.27
.........
.........
[INFO] Final Memory: 112M/606M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project oozie-core: Could not resolve dependencies for project org.apache.oozie:oozie-core:jar:4.3.0:
Could not find artifact org.pentaho:pentaho-aggdesigner-algorithm:jar:5.1.5-jhyde in Central () -> [Help 1]

[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1]
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn -rf :oozie-core


7.Could not find artifact org.pentaho:pentaho-aggdesigner-algorithm:jar:5.1.5-jhyde in Central
7.1下載不了該jar包 我就手工下載,先找到下載地址,就會發現該jar包來源根本不是maven的central倉庫,而是spring




7.2 進機器的~/.m2/repository/org/pentaho/pentaho-aggdesigner-algorithm/5.1.5-jhyde/,清除,手工上傳win7下載好的jar包

[root@sht-sgmhadoopdn-04 5.1.5-jhyde]# rm -rf *
[root@sht-sgmhadoopdn-04 5.1.5-jhyde]# wget
[root@sht-sgmhadoopdn-04 5.1.5-jhyde]# ll
total 48
-rw-r--r-- 1 root root 48557 Apr 25 16:44 pentaho-aggdesigner-algorithm-5.1.5-jhyde.jar
[root@sht-sgmhadoopdn-04 5.1.5-jhyde]# 

8.第二次編譯
[root@sht-sgmhadoopdn-04 oozie_source]# bin/mkdistro.sh  -DskipTests -Puber -Phadoop-2 \
-Dhadoop.version=2.7.2 \
-Dhadoop.auth.version=2.7.2 \
-Ddistcp.version=2.7.2 \
-Dsqoop.version=1.4.3 \
-Dhive.version=1.2.0 \
-Dhbase.version=0.94.27
.........
.........
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-site-plugin:2.0-beta-6:site (default) on project oozie-docs:
Execution default of goal org.apache.maven.plugins:maven-site-plugin:2.0-beta-6:site failed: Plugin org.apache.maven.plugins:maven-site-plugin:2.0-beta-6 or one of its dependencies 
could not be resolved: The following artifacts could not be resolved: org.apache.maven.doxia:doxia-module-twiki:jar:1.0-alpha-9.2y, 
org.apache.maven.doxia:doxia-core:jar:1.0-alpha-9.2y: Could not find artifact org.apache.maven.doxia:doxia-module-twiki:jar:1.0-alpha-9.2y 
in Central () -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1]
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn -rf :oozie-docs


9. could not be resolved: org.apache.maven.doxia:doxia-module-twiki:jar:1.0-alpha-9.2y, org.apache.maven.doxia:doxia-core:jar:1.0-alpha-9.2y
9.1下載不了該jar包 我就手工下載,先找到下載地址,就會發現該jar包來源根本不是maven的central倉庫,而是cloudera
doxia-module-twiki-1.0-alpha-9.2y.jar:


doxia-core-1.0-alpha-9.2y.jar:



9.2進~/.m2/repository/org/apache/maven/doxia/doxia-module-twiki/1.0-alpha-9.2y,下載 doxia-module-twiki-1.0-alpha-9.2y.jar
[root@sht-sgmhadoopdn-04 1.0-alpha-9.2y]# pwd
/root/.m2/repository/org/apache/maven/doxia/doxia-module-twiki/1.0-alpha-9.2y
[root@sht-sgmhadoopdn-04 1.0-alpha-9.2y]# rm -rf *
[root@sht-sgmhadoopdn-04 1.0-alpha-9.2y]# wget --no-check-certificate

9.3進~/.m2/repository/org/apache/maven/doxia/doxia-core/1.0-alpha-9.2y,下載 doxia-core-1.0-alpha-9.2y.jar:
[root@sht-sgmhadoopdn-04 1.0-alpha-9.2y]# pwd
/root/.m2/repository/org/apache/maven/doxia/doxia-module-twiki
[root@sht-sgmhadoopdn-04 1.0-alpha-9.2y]# rm -rf *
[root@sht-sgmhadoopdn-04 1.0-alpha-9.2y]# wget --no-check-certificate


9.第三次編譯
[root@sht-sgmhadoopdn-04 oozie_source]# bin/mkdistro.sh  -DskipTests -Puber -Phadoop-2 \
-Dhadoop.version=2.7.2 \
-Dhadoop.auth.version=2.7.2 \
-Ddistcp.version=2.7.2 \
-Dsqoop.version=1.4.3 \
-Dhive.version=1.2.0 \
-Dhbase.version=0.94.27
........
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] Apache Oozie Main .................................. SUCCESS [  2.121 s]
[INFO] Apache Oozie Hadoop Utils hadoop-2-4.3.0 ........... SUCCESS [  3.706 s]
[INFO] Apache Oozie Hadoop Distcp hadoop-2-4.3.0 .......... SUCCESS [  0.178 s]
[INFO] Apache Oozie Hadoop Auth hadoop-2-4.3.0 Test ....... SUCCESS [  0.781 s]
[INFO] Apache Oozie Hadoop Libs ........................... SUCCESS [  0.043 s]
[INFO] Apache Oozie Client ................................ SUCCESS [ 24.672 s]
[INFO] Apache Oozie Share Lib Oozie ....................... SUCCESS [  3.791 s]
[INFO] Apache Oozie Share Lib HCatalog .................... SUCCESS [  5.554 s]
[INFO] Apache Oozie Share Lib Distcp ...................... SUCCESS [  1.478 s]
[INFO] Apache Oozie Core .................................. SUCCESS [01:24 min]
[INFO] Apache Oozie Share Lib Streaming ................... SUCCESS [  6.369 s]
[INFO] Apache Oozie Share Lib Pig ......................... SUCCESS [  7.963 s]
[INFO] Apache Oozie Share Lib Hive ........................ SUCCESS [  9.024 s]
[INFO] Apache Oozie Share Lib Hive 2 ...................... SUCCESS [  7.739 s]
[INFO] Apache Oozie Share Lib Sqoop ....................... SUCCESS [  3.303 s]
[INFO] Apache Oozie Examples .............................. SUCCESS [  7.334 s]
[INFO] Apache Oozie Share Lib Spark ....................... SUCCESS [ 11.843 s]
[INFO] Apache Oozie Share Lib ............................. SUCCESS [ 29.395 s]
[INFO] Apache Oozie Docs .................................. SUCCESS [ 16.603 s]
[INFO] Apache Oozie WebApp ................................ SUCCESS [01:23 min]
[INFO] Apache Oozie Tools ................................. SUCCESS [  5.716 s]
[INFO] Apache Oozie MiniOozie ............................. SUCCESS [  3.058 s]
[INFO] Apache Oozie Distro ................................ SUCCESS [01:05 min]
[INFO] Apache Oozie ZooKeeper Security Tests .............. SUCCESS [ 20.784 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 06:47 min
[INFO] Finished at: 2017-04-25T17:32:58+08:00
[INFO] Final Memory: 581M/1067M
[INFO] ------------------------------------------------------------------------


Oozie distro created, DATE[2017.04.25-09:26:09GMT] VC-REV[unavailable], available at [/root/learnproject/app/oozie-source/oozie-4.3.0/distro/target]

10.生成的檔案oozie-4.3.0-distro.tar.gz
[root@sht-sgmhadoopdn-04 oozie-4.3.0]# cd /root/learnproject/app/oozie-source/oozie-4.3.0/distro/target
[root@sht-sgmhadoopdn-04 target]# ll
total 440024
drwxr-xr-x 2 root root      4096 Apr 25 17:31 antrun
drwxr-xr-x 2 root root      4096 Apr 25 17:31 archive-tmp
drwxr-xr-x 3 root root      4096 Apr 25 17:31 classes
drwxr-xr-x 2 root root      4096 Apr 25 17:31 maven-archiver
drwxr-xr-x 3 root root      4096 Apr 25 17:31 maven-shared-archive-resources
drwxr-xr-x 3 root root      4096 Apr 25 17:32 oozie-4.3.0-distro
-rw-r--r-- 1 root root 450528886 Apr 25 17:32 oozie-4.3.0-distro.tar.gz
-rw-r--r-- 1 root root     14458 Apr 25 17:31 oozie-distro-4.3.0.jar
drwxr-xr-x 3 root root      4096 Apr 25 17:31 test-classes
drwxr-xr-x 3 root root      4096 Apr 25 17:31 tomcat
[root@sht-sgmhadoopdn-04 target]# ll oozie-4.3.0-distro.tar.gz
-rw-r--r-- 1 root root 450528886 Apr 25 17:32 oozie-4.3.0-distro.tar.gz
You have mail in /var/spool/mail/root
[root@sht-sgmhadoopdn-04 target]# 

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/30089851/viewspace-2137979/,如需轉載,請註明出處,否則將追究法律責任。

相關文章