nexus+maven+eclipse

1)下载nexus,最新版本是nexus-2.8.0-05  

2)下载nexus-latest-bundle.zip文件后,并解压到  D:\nexus下

3)配置nexus的环境变量:先配置NEXUS_HOME的环境变量,新建一个系统变量:NEXUS_HOME , 路径是:D:\nexus\nexus-2.8.0-05,如图所示:

4)再配置path环境变量,在path值的末尾添加"%NEXUS_HOME%\bin\jsw\windows-x86-64",如下图所示:

5)配置完成后cmd命令执行 D:\nexus\nexus-2.8.0-05\bin\jsw\windows-x86-64安装install-nexus.bat服务,服务安装成功后执行start-nexus.bat启动服务,Nexus启动成功了,然后打开浏览器,访问http://127.0.0.1:8081/nexus,你会看到如下的页面:

6)

配置Maven使用Nexus:

配置maven中心库地址在setting.xml的<profiles></profiles>之间增加如下配置

<profile>

       <id>nexus</id>

        <repositories>

        <repository>

        <id>nexus</id>

        <name>Nexus</name>

<url>http://localhost:8081/nexus/content/groups/public/</url>

<release><enabled>true</enabled></release>

        <snapshots><enabled>true></enabled></snapshots>

        </repository>

        </repositories>

        <pluginRepositories>

        <pluginRepository>

        <id>nexus</id>

        <name>Nexus</name>

        <url>http://localhost:8081/nexus/content/groups/public/</url>

        <release><enabled>true</enabled></release>

        <snapshots><enabled>true></enabled></snapshots>

        </pluginRepository>

        </pluginRepositories>

    </profile>

  </profiles>

<activeProfiles>

<activeProfile>nexus</activeProfile>

</activeProfiles>

<localRepository>D:/czb/workspaces/maven/repo</localRepository>

Pom.xml运行的时候可能出现错误,可能标签有问题

 7)

 装maven之前,要先安装jdk及配置JAVA_HOME环境变量。JDK1.4以上。

下载maven3,最新版本是Maven3.0.3,下载地址:http://maven.apache.org/download.html

下载apache-maven-3.0.3-bin.zip文件后,并解压到D:\tools\apache-maven-3.0.3

配置maven3的环境变量,先配置M2_HOME的环境变量,值为"D:\tools\apache-maven-3.0.3",(设置环境变量,设置到系统环境变量中去,不要设置在上面的用户环境变量,因为系统环境变量权限更大)如下图所示:

 

8)再配置path环境变量,在path值的末尾添加"%M2_HOME%\bin",(设置环境变量,设置到系统环境变量中去,不要设置在上面的用户环境变量,因为系统环境变量权限更大)如下图所示:

9)打开cmd命令窗口,执行"mvn -version",会输出下面的内容,表示安装成功。

64位下如下:

10)

Eclipse插件安装

         点击菜单 Help -> Install new software 进行插件安装

         插件地址 http://m2eclipse.sonatype.org/sites/m2e

12)如果你已经成功安装了这个插件,当你打开Window→ Preferences...的时候,你应该能够在一个选项列表中看到一个Maven选项

安装好m2eclipse插件后,要作两个设置
  a) 禁用Downloadrepository index updates on startup(即取消这个选项的勾选,第三个第四个可以点上),如下图
  b) 设置maven的setting.xml文件路径(setting路径可能跟上面不对应,要根据你自己路径来设置查找),如下图 
 
上面setting路径根据自己设置的路径

 

posted @ 2016-01-14 16:40  Mr、Bo  阅读(747)  评论(0编辑  收藏  举报