大数据交流群: 494721467

安装maven:

 

1、介绍:apache项目管理软件,解决项目依赖关系 pom.xml(project object model)

 

2、下载apache-maven-3.3.9.tar.gz(apache)

 

3、在linuxtar文件 :tar -xvzf xxx.tar.gz

 

4、移动tar开目录到/soft    :mv apache-maven-xx /soft

 

5、创建符号链接   :ln  -s /soft/apache-maven-xx /soft/maven

 

6、配置环境变量M2_HOME=/soft/maven

完整路径配置:

M2_HOME=/soft/maven

HADOOP_HOME=/soft/hadoop

JAVA_HOME=/soft/jdk

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/soft/jdk/bin:/soft/eclipse:/soft/hadoop/bin:/soft/hadoop/sbin:/soft/maven/bin"

 

 

7、立即生效:source /etc/environment

 

8、对toolchains.xml文件配置。进入到/soft/maven/conf目录下

 

9、在soft/maven/conf$ 编辑:gedit settings.xml下面试配置文件:

1

    

        nexus-osc

        central

        Nexus osc

        http://maven.oschina.net/content/groups/public/

    

    

        nexus-osc-thirdparty

        thirdparty

        Nexus osc thirdparty

        http://maven.oschina.net/content/repositories/thirdparty/

    

 

2jdk-1.4

    

        1.4

    

    

        

            nexus

            local private nexus

            http://maven.oschina.net/content/groups/public/

            

                true

            

            

                false

            

        

    

    

        

            nexus

            local private nexus

            http://maven.oschina.net/content/groups/public/

            

                true

            

            

                false

            

        

    

 

10、在~/downloads/hadoop-lzo-master$下执行:mvn clean test#使用maven 清理和测试