免费视频淫片aa毛片_日韩高清在线亚洲专区vr_日韩大片免费观看视频播放_亚洲欧美国产精品完整版

打開APP
userphoto
未登錄

開通VIP,暢享免費電子書等14項超值服

開通VIP
Linux下使用Nexus做Maven倉庫管理

一:JDK

1.Installation

  • Download the lasted version of the JDK from: http://java.sun.com ,now is JDK1.7.0_10.
  • Unpack the arcive to /usr/lib/jvm/java with the below command line:

         tar -zxvf jdk-7u10-linux-i586.tar.gz

2. Set java environment variable

# vi /etc/profile

# This is added by selina for set java environment:

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

# end of set java environmnet

save and exit.

# source /etc/profile //with immediate effect

# java -version or echo $JAVA_HOME

check whether take effect :logout then

# java -version or echo $JAVA_HOME

 

二:Maven

1.Installation

  • Download the lasted version of the Maven from http://maven.apache.org/download.html ,now is 3.0.4 .
  • Unapack the archive to /usr/local with beow the command line :
  •        tar -zxvf  apache-maven-3.0.4-bin.tar.gz
  • rename apache-maven-3.0.as maven3
  •      mv apache-maven-3.0.4 maven3

2.Set Maven environment variable

# vi /etc/profile

 # This is added by selina for set Maven environment:

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 //with immediate effect

mvn -v or echo $MAVEN_HOME

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.sonatype.org/downloads/ ,now is nexus-2.2-01.

Unpack the archive to /usr/local with the below command line

   tar -zxvf nexus-2.2-01-bundle.tar.gz

and remane to nexus2 with the below command line

   mv nexus-2.2-01-bundle nexus2

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 :

       Starting Nexus OSS...

      Stared Nexus OSS

But ,after installing nexus ,excute command "./nexus start" failed ,show the below message:

       Starting Nexus OSS...

      Failed to start Nexus OSS.

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 ,failed ,need to see log message from: ./nexus/logs/wrapper.log ,show "Unable to start JVM: No such file or directory" in here ,

Solution : editing "<nexus_root>/bin/jsw/conf/wrapper.conf" and changing "wrapper.java.commad" the full path to my java executable

wrapper.java.commad={JAVA_HOME}/bin/java

Again to http://ip:8081/nexus ,failed ,see log message ,show " error..Temp directory:/usr/lcoal/sonatype-work/nexus/tmp "

Solution : chmod -R 777 /usr/local/sonatype-work/nexus/tmp

 

 Congratulations ,well done.Click the "Login In" on the top right corner.the default username is admin ,password is admin123.Linux下使用Nexus做Maven倉庫管理

登錄后最重要的事情就是打開遠程索引下載,操作為選擇菜單Administrator->Repositories,然后在右邊打開的列表中依次選擇type字段為proxy的記錄,在下方的編輯區(qū)中修改"Download Remote Indexes"值為true,再從這三個倉庫上點右鍵選擇"Reapir Index",這一步別忘,Repair Index后,Nexus會從后臺去官方地址下載倉庫索引文件,大概20M大小,根據(jù)網(wǎng)速快慢下載相應時間后選擇倉庫時會以樹形目錄的方式顯示倉庫內容。(注意:如果repaire-index后,在“browser index"里仍然看不到東西,要確定/usr/lcoal/sonatype-work/nexus目錄是否有寫權限 )Central的"Remote storage location"默認的是http://repo1.maven.org/maven2,因這是國外網(wǎng)站,忒慢,如此找到了以下這個源鏡像:http://repo.maven.apache.org/maven2Linux下使用Nexus做Maven倉庫管理想要maven使用剛剛配置的nexus服務作為倉庫服務器需要修改settings.xml文件。

在maven中存在兩個 settings.xml,一個位于maven2的安裝目錄conf下面,作為全局性配置。對于團隊設置,保持一致的定義是關鍵,所以 maven/conf下面的settings.xml就作為團隊共同的配置文件。保證所有的團隊成員都擁有相同的配置。當然對于每個成員,都需要特殊的 自定義設置,如用戶信息,所以另外一個settings.xml就作為本地配置。默認的位置為:${HOME} /.m2/settings.xml目錄
 

<settings> 
<!--<localRepository>這個是存放eclipse項目需要費用的jar包(在eclipse項目添加maven依賴的時候,eclipse自動從nexus服務器中下載jar包,然后存到這個路徑,默認路徑是~/.m2/repository,可以不修改-->
  <localRepository>/resource/java/repos/maven-repo</localRepository>

<servers> 
      <server> 
         <!-- 這是server的id(注意不是用戶登陸的id),該id與pom.xml 中distributionManagement中repository元素的id相匹配。--> 
         <!--遠程nexus 服務器的用戶名與密碼,作用就是當要向nexus deploy 自已寫的jar 時,會用到在pom.xml 中distributionManagement ,在那里會引用此處的id --> 
         <id>releases</id> 
         <username>admin</username> 
         <password>admin123</password> 
</server>
 <server> 
         <id>snapshots</id> 
         <username>admin</username> 
         <password>admin123</password> 
</server>
</servers> 

<mirrors>
<mirror>
      <!--This sends everything else to /public -->
     <!--該鏡像的唯一標識符。id用來區(qū)分不同的mirror元素。 -->
     
      <id>nexus</id>
      <!--該鏡像的URL。構建系統(tǒng)會優(yōu)先考慮使用該URL,而非使用默認的服務器URL --> 
      <url>http://localhost:8081/nexus/content/groups/public</url>
      <!--被鏡像的服務器的id。例如,如果我們要設置了一個Maven中央倉庫http://repo1.maven.org/maven2)的鏡像,就需要將該元素設置成central。這必須和中央倉庫的id central完全一致。 --> 
            <mirrorOf>central</mirrorOf> 

 </mirror>
</mirrors>

<profiles>
<!--個性配置。類似于pom.xml中的profile元素。單獨定義profile后,并不會生效,需要通過滿足條件來激活-->
<profile>
     <!--該配置的唯一標識符。 -->  
     <id>development</id>  
      <repositories>  
         <!--包含需要連接到遠程倉庫的信息 -->       
         <repository>
            <!--遠程倉庫唯一標識-->          
            <id>central</id>          
            <name>local private nexus</name>             
           <url>http://127.0.0.1:8081/nexus/content/groups/public</url>                     
             <!--如何處理遠程倉庫里發(fā)布版本的下載-->            
             <releases><enabled>true</enabled></releases>
             <snapshots><enabled>false</enabled></snapshots>
        </repository>     
      </repositories>    
      <pluginRepositories>   
        <pluginRepository>        
           <id>central</id>           
           <name>local private nexus</name>     
           <url>http://127.0.0.1:8081/nexus/content/groups/public</url>                                      <releases><enabled>true</enabled></releases>         
           <snapshots><enabled>false</enabled></snapshots>      
       </pluginRepository>   
    </pluginRepositories>
</profile>
</profiles>
<activeProfiles>
    <activeProfile>development</activeProfile>
</activeProfiles>
</settings>


然后,在從你的工程里的pom.xml中加入以下內容:

 
<distributionManagement>
 <repository>
<!--ID要與maven中的setting.xml中的ID一致-->
  <id>releases</id>
  <name>Nexus Release Repo</name>
  <url>http://localhost:8081/nexus/content/repositories/releases</url>
 </repository>
 <snapshotRepository>
<!--ID要與maven中的setting.xml中的ID一致-->
  <id>snapshots</id>
  <name>snapshots</name>
  <url>http://localhost:8081/nexus/content/repositories/snapshots</url>
 </snapshotRepository>
</distributionManagement>


網(wǎng)絡其它好文章鏈接:http://my.oschina.net/aiguozhe/blog/101537 

  

 

 

本站僅提供存儲服務,所有內容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權內容,請點擊舉報
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
flink
Java TestNG入門 -1 Maven配置
Java技術學習筆記:Maven安裝和作用
持續(xù)集成之路——搭建Maven私服
Linux(CentOS7.x)安裝Maven
用nexus搭建自己的maven私有倉庫
更多類似文章 >>
生活服務
分享 收藏 導長圖 關注 下載文章
綁定賬號成功
后續(xù)可登錄賬號暢享VIP特權!
如果VIP功能使用有故障,
可點擊這里聯(lián)系客服!

聯(lián)系客服