一:JDK 1.Installation
2. Set java environment variable # vi /etc/profile JAVA_HOME=/usr/lib/jvm/java/jdk1.7.0_10 JRE_HOME=/usr/lib/jvm/java/jdk1.7.0_10/jre export JAVA_HOME export JRE_HOME export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH save and exit. # source
/etc/profile # java -version or echo $JAVA_HOME check whether take effect :logout then # java -version or echo $JAVA_HOME 二:Maven 1.Installation
2.Set Maven environment variable # vi /etc/profile MAVEN_HOME=/usr/local/maven3 export MAVEN_HOME export PATH=$MAVEN_HOME/bin:$PATH # end of set java environmnet save and exit. # source
/etc/profile # check whether take effect :logout then # mvn -v or echo $MAVEN_HOME Note that if you use "mvn -v" to see ,will show maven and jave version info indicate that successfully installed and configured. 三:Nexus 1.Installation Download
the lasted version of the Nexus from http://nexus./downloads/ Unpack and remane to nexus2 with the below command line 2. Run Nexus $ cd /usr/local/nexus2/bin/jsw/linux-x86-32 $ ./nexus start (restart/stop...) # use ordinary account not root if successd ,Go to browser http://ip:8081/nexus ,account and passowd is admin and admin123 (if you want to change port number ,pls go to ./nexus2/conf/nexus.properties to set ,the default is 8081) issues: (1)if successfully installed ,will show : But ,after installing nexus ,excute command "./nexus start" failed ,show the below message: Solution : this is casued by priviledge of nexus directory ,it belongs to root user .After change the owner of the nexus directory to the current user ,rerun the command "./nexus start",it works. sudo chown -R selina:selina ../../nexus (2)Can't browser when http://ip:8081/nexus Solution
: wrapper.java.commad={JAVA_HOME}/bin/java Again
to http://ip:8081/nexus Solution : chmod -R 777 /usr/local/sonatype-work/nexus/tmp
登录后最重要的事情就是打开远程索引下载,操作为选择菜单Administrator->Repositories,然后在右边打开的列表中依次选择type字段为proxy的记录,在下方的编辑区中修改"Download
Remote Indexes"值为true,再从这三个仓库上点右键选择"Reapir Index",这一步别忘,Repair
Index后,Nexus会从后台去官方地址下载仓库索引文件,大概20M大小,根据网速快慢下载相应时间后选择仓库时会以树形目录的方式显示仓库内容。(注意:如果repaire-index后,在“browser
index"里仍然看不到东西,要确定/usr/lcoal/sonatype-work/nexus目录是否有写权限
)Central的"Remote storage location"默认的是http://repo1./maven2,因这是国外网站,忒慢,如此找到了以下这个源镜像:http://repo.maven./maven2 在maven中存在两个
settings.xml,一个位于maven2的安装目录conf下面,作为全局性配置。对于团队设置,保持一致的定义是关键,所以
maven/conf下面的settings.xml就作为团队共同的配置文件。保证所有的团队成员都拥有相同的配置。当然对于每个成员,都需要特殊的
自定义设置,如用户信息,所以另外一个settings.xml就作为本地配置。默认的位置为:${HOME}
/.m2/settings.xml目录
<settings>
<servers>
<mirrors>
<profiles> |