前提要有jdk环境,官方下载nexus和maven,解压后创建两个文件方便启动和停止nexus
startNexus.sh
#!/bin/bash
echo start nexus
echo nexus url is : http://localhost:8081/nexus
cd ~
cd /media/software/nexus/nexus1.9/nexus-oss-webapp-1.9.1.1/bin/jsw/linux-x86-32
./nexus start
echo start success!
stopNexus.sh
#!/bin/bash
echo stop nexus
cd ~
cd /media/software/nexus/nexus1.9/nexus-oss-webapp-1.9.1.1/bin/jsw/linux-x86-32
./nexus stop
echo over!
配置maven环境变量:
sudo gedit /etc/profile
最后添加如下代码:
#java
export JAVA_HOME=/home/chenjun/java/jdk1.6.0_31
#maven
export M3_HOME=/media/software/maven/apache-maven-3.0.3
export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$M3_HOME/bin:$PATH
export CLASSPATH=$CLASSPATH:.:$JAVA_HOME/lib:$JAVA_HOME/jre/
执行source /etc/profile 更新配置文件信息,重启电脑
mvn -version 测试是否成功
复制$M3_HOME/conf/settings.xml到~/.m2/目录下面:
可以修改仓库的默认位置:
<localRepository>/media/software/repository</localRepository>
添加代码:
<profile>
<id>nexus</id>
<repositories>
<repository>
<id>nexus</id>
<name>nexus</name>
<url>http://localhost:8081/nexus/content/groups/public</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>nexus</id>
<name>nexus</name>
<url>http://localhost:8081/nexus/content/groups/public</url>
</pluginRepository>
</pluginRepositories>
</profile>
<activeProfiles>
<activeProfile>nexus</activeProfile>
</activeProfiles>
在server标签中添加用户和密码。
启动nexus脚本文件。
启动eclipse添加m2e插件,http://download.eclipse.org/technology/m2e/releases,然后添加自己的maven。
添加下面配置可以修改项目的jdk版本
<profile>
<id>jdk-1.6</id>
<activation>
<activeByDefault>true</activeByDefault>
<jdk>1.6</jdk>
</activation>
<properties>
<maven.compiler.source>1.6</maven.compiler.source>
<maven.compiler.target>1.6</maven.compiler.target>
<maven.compiler.compilerVersion>1.6</maven.compiler.compilerVersion>
</properties>
</profile>
添加下面配置使得所有的下载都通过nexus:
<mirror>
<id>nexus</id>
<mirrorOf>*</mirrorOf>
<name>nexus</name>
<url>http://localhost:8081/nexus/content/groups/public</url>
</mirror>
分享到:
相关推荐
ubuntu10.04安装配置指南.docx
VM7安装Ubuntu 10.04系统 VM7安装Ubuntu 10.04系统
ubuntu 10.04下的网络电视安装文件1 sopcast-player
ubuntu10.04 安装 opencv2.2.0
ubuntu10.04界面汉化安装包,deb格式。由于包的相互依赖,需用如下命令安装: #dpkg -i language-pack-zh-hans_1%3a10.04+20100421_all.deb language-pack-zh-hans-base_1%3a10.04+20100421_all.deb language-pack-...
安装Ubuntu10.04全过程(图解)
Ubuntu 10.04完全版入门教程 包含Ubuntu安装,配置过程,以及shell编程等内容。 分两部分: Ubuntu 10.04完全版first part Ubuntu 10.04完全版second part
Ubuntu10.04下Oracle10g安装全过程.pdf
主要介绍了关于嵌入式开发的环境配置 开发环境是Ubuntu 10.04LTS
介绍最新版本Ubuntu10.04的安装,配置,shell编程等内容,快速入门提高的资料。 分两卷: Ubuntu10.04入门教程01 Ubuntu10.04入门教程02
ubuntu10.04下安装NS2.34的说明文档,亲测,按步骤做可以轻松安装
20160921ubuntu10.04 nfs,tftp安装、配置以及错误。以及相关截图配置截图说明。
官方的chrome 只支持12.04以上的版本,由于所需的库不同 ubuntu 10.04 只能用之前的版本
Ubuntu 10.04安装完全指南,Ubuntu 10.04安装完全指南
Ubuntu10.04LTS图形安装教程、网络设置、软件源、硬盘安装参考.pdf
ubuntu下安装jdk1.6的过程,包括报错的处理等
VMware_Workstation中安装Ubuntu10.04 VMware_Workstation中安装Ubuntu10.04
最近开始学习Linux操作系统,遇到了很多问题,走了不少弯路。 Linux的却比windows强大很多,但像我这样刚入门的,用起来却不那么顺手。就拿上网来说吧,我在网上查了...此方法只适用于Ubuntu10.04,低版本我没试过。
在ubuntu 10.04下安装svn server的过程;包括配置和client的使用等
Ubuntu10.04下安装NS2.34 NS2.35的具体步骤