大數據交流羣: 494721467
安裝maven:
1、介紹:apache項目管理軟件,解決項目依賴關係 pom.xml(project object model)
2、下載apache-maven-3.3.9.tar.gz(apache)
3、在linux上tar文件 :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、<mirrors>
<mirror>
<id>nexus-osc</id>
<mirrorOf>central</mirrorOf>
<name>Nexus osc</name>
<url>http://maven.oschina.net/content/groups/public/</url>
</mirror>
<mirror>
<id>nexus-osc-thirdparty</id>
<mirrorOf>thirdparty</mirrorOf>
<name>Nexus osc thirdparty</name>
<url>http://maven.oschina.net/content/repositories/thirdparty/</url>
</mirror>
</mirrors>
2、<id>jdk-1.4</id>
<activation>
<jdk>1.4</jdk>
</activation>
<repositories>
<repository>
<id>nexus</id>
<name>local private nexus</name>
<url>http://maven.oschina.net/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>nexus</id>
<name>local private nexus</name>
<url>http://maven.oschina.net/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
10、在~/downloads/hadoop-lzo-master$下執行:mvn clean test#使用maven 清理和測試