eclipse配置maven

下载maven
http://mirror.bit.edu.cn/apache/maven/maven-3/3.2.1/binaries/apache-maven-3.2.1-bin.tar.gz
安装:
tar -xvf apache-maven-3.2.1-bin.tar.gz
sudo mv apache-maven-3.2.1 /usr/local/maven
配置:
vim /etc/profile
#maven
export MAVEN_HOME=/usr/local/maven
export PATH=$MAVEN_HOME/bin:$PATH
source /etc/profile
vim /usr/local/maven/conf/settings.xml
  <localRepository>/opt/hn/mavenRep</localRepository>
...
    <proxy>
      <id>optional</id>
      <active>true</active>
      <protocol>http</protocol>
      <host>proxy.com</host>
      <port>8080</port>
    </proxy>
...
    <mirror>
        <id>nexus-osc</id>
        <mirrorOf>*</mirrorOf>
        <name>Nexus osc</name>
        <url>http://maven.oschina.net/content/groups/public/</url>
    </mirror>
保存推出
验证
mvn -version
下载64位eclipse for linux安装
安装eclipse maven
http://download.jboss.org/jbosstools/updates/m2eclipse-wtp/
 打开eclipse,选择import maven projects

 

源代码目录/usr/local/hadoopSRC下,创建一个文件eclipseReload.sh,修改文件内容如下:

#!/bin/sh
mvn clean compile
mvn eclipse:clean
mvn eclipse:eclipse

保存退出。

 

     <mirror>
           <id>ibiblio.org</id>
           <name>ibiblio Mirror of http://repo1.maven.org/maven2/</name>
           <url>http://mirrors.ibiblio.org/pub/mirrors/maven2</url>
           <mirrorOf>central</mirrorOf>
           <!-- United States, North Carolina -->
     </mirror>
     <mirror>
         <id>jboss-public-repository-group</id>
         <mirrorOf>central</mirrorOf>
         <name>JBoss Public Repository Group</name>
         <url>http://repository.jboss.org/nexus/content/groups/public</url>
     </mirror> 

 

http://download.jboss.org/jbosstools/updates/m2eclipse-wtp/

 

你可能感兴趣的:(eclipse)