How to install maven-3.3.9
This article mainly explains "how to install maven-3.3.9". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Now let the editor take you to learn how to install maven-3.3.9.
1.Java version 1.8
[root@sht-sgmhadoopdn-04 app] # java-version
Java version "1.8.0mm 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 installation
[root@sht-sgmhadoopdn-04 app] # wget http://mirrors.hust.edu.cn/apache/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz
[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. Modify the warehouse settings for maven
# here we need to compile oozie, so instead of the Aliyun repository (many of which have incomplete dependencies), we will use the central repository of maven.
[root@sht-sgmhadoopdn-04 app] # cd / root/learnproject/app/maven/conf
[root@sht-sgmhadoopdn-04 conf] # vi settings.xml
Click (here) to collapse or open
Central
*
Central
Http://central.maven.org/maven2/
Nexus-aliyun
*
Nexus aliyun
Http://maven.aliyun.com/nexus/content/groups/public
Download and decompress the 4.oozie-4.3.0 source code file
[root@sht-sgmhadoopdn-04 app] # mkdir oozie_source
[root@sht-sgmhadoopdn-04 app] # cd oozie_source
[root@sht-sgmhadoopdn-04 oozie_source] # wget http://apache.fayea.com/oozie/4.3.0/oozie-4.3.0.tar.gz
[root@sht-sgmhadoopdn-04 oozie_source] # tar-xzvf oozie-4.3.0.tar.gz
5. Modify pom.xml to 1.8
[root@sht-sgmhadoopdn-04 oozie_source] # cd oozie-4.3.0
[root@sht-sgmhadoopdn-04 oozie_source] # vi pom.xml
Click (here) to collapse or open
1.8
1.8
1.7
6. First compilation
[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 (http://central.maven.org/maven2/)-> [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] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
[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
If I cannot download the jar package, I will download it manually. If I find the download address first, I will find that the source of the jar package is not maven's central repository at all, but spring.
Http://repo.spring.io/plugins-release/org/pentaho/pentaho-aggdesigner-algorithm/5.1.5-jhyde/pentaho-aggdesigner-algorithm-5.1.5-jhyde.jar
7.2 clear the ~ / .m2 / repository/org/pentaho/pentaho-aggdesigner-algorithm/5.1.5-jhyde/, of the machine, and manually upload the win7 downloaded jar package.
[root@sht-sgmhadoopdn-04 5.1.5-jhyde] # rm-rf *
[root@sht-sgmhadoopdn-04 5.1.5-jhyde] # wget http://repo.spring.io/plugins-release/org/pentaho/pentaho-aggdesigner-algorithm/5.1.5-jhyde/pentaho-aggdesigner-algorithm-5.1.5-jhyde.jar
[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. Second compilation
[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 (http://central.maven.org/maven2/)-> [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] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
[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
If I can't download the jar package, I will download it manually. If I find the download address first, I will find that the source of the jar package is not maven's central repository at all, but cloudera.
Doxia-module-twiki-1.0-alpha-9.2y.jar:
Https://repository.cloudera.com/content/repositories/releases/org/apache/maven/doxia/doxia-module-twiki/1.0-alpha-9.2y/doxia-module-twiki-1.0-alpha-9.2y.jar
Doxia-core-1.0-alpha-9.2y.jar:
Https://repository.cloudera.com/content/repositories/releases/org/apache/maven/doxia/doxia-core/1.0-alpha-9.2y/doxia-core-1.0-alpha-9.2y.jar
9.2 enter ~ / .m2 / repository/org/apache/maven/doxia/doxia-module-twiki/1.0-alpha-9.2y and download 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 https://repository.cloudera.com/content/repositories/releases/org/apache/maven/doxia/doxia-module-twiki/1.0-alpha-9.2y/doxia-module-twiki-1.0-alpha-9.2y.jar-- no-check-certificate
9.3 enter ~ / .m2 / repository/org/apache/maven/doxia/doxia-core/1.0-alpha-9.2y and download 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 https://repository.cloudera.com/content/repositories/releases/org/apache/maven/doxia/doxia-core/1.0-alpha-9.2y/doxia-core-1.0-alpha-9.2y.jar-- no-check-certificate
9. The third compilation
[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 [April 25, 2017-09:26:09GMT] VC-REV [unavailable], available at [/ root/learnproject/app/oozie-source/oozie-4.3.0/distro/target]
10. Generated file 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] #
At this point, I believe you have a deeper understanding of "how to install maven-3.3.9". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!