|
一: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
登錄后最重要的事情就是打開遠(yuǎn)程索引下載,操作為選擇菜單Administrator->Repositories,然后在右邊打開的列表中依次選擇type字段為proxy的記錄,在下方的編輯區(qū)中修改"Download
Remote Indexes"值為true,再從這三個(gè)倉庫上點(diǎn)右鍵選擇"Reapir Index",這一步別忘,Repair
Index后,Nexus會(huì)從后臺(tái)去官方地址下載倉庫索引文件,大概20M大小,根據(jù)網(wǎng)速快慢下載相應(yīng)時(shí)間后選擇倉庫時(shí)會(huì)以樹形目錄的方式顯示倉庫內(nèi)容。(注意:如果repaire-index后,在“browser
index"里仍然看不到東西,要確定/usr/lcoal/sonatype-work/nexus目錄是否有寫權(quán)限
)Central的"Remote storage location"默認(rèn)的是http://repo1./maven2,因這是國外網(wǎng)站,忒慢,如此找到了以下這個(gè)源鏡像:http://repo.maven./maven2 在maven中存在兩個(gè)
settings.xml,一個(gè)位于maven2的安裝目錄conf下面,作為全局性配置。對(duì)于團(tuán)隊(duì)設(shè)置,保持一致的定義是關(guān)鍵,所以
maven/conf下面的settings.xml就作為團(tuán)隊(duì)共同的配置文件。保證所有的團(tuán)隊(duì)成員都擁有相同的配置。當(dāng)然對(duì)于每個(gè)成員,都需要特殊的
自定義設(shè)置,如用戶信息,所以另外一個(gè)settings.xml就作為本地配置。默認(rèn)的位置為:${HOME}
/.m2/settings.xml目錄
<settings>
<servers>
<mirrors>
<profiles> |