大數(shù)據(jù)交流群:494721467
Maven搭建本地倉庫:
1、下載所需軟件:
Nexus-2 .9.0.war
JDK1 1.6
apache-tomcat-9.0.0.M1.tar.gz
2、安裝tomcat :tar -xzvf tar -xzvf apache-tomcat-9.0.0.M1.tar.后將它移到/soft/的目錄下
3、移動nexus.war到${tomact_home}/webapps/即執(zhí)行:mv nexus.war /soft/tomcat/webapps
4、啟動tomcat在~的目錄下啟動:ubuntu@s1:~$ /soft/tomcat/bin/startup.sh
5、進(jìn)入web頁面查看它有沒有成功即登錄s1:8080
在宿主機(jī)上安裝maven本地倉庫服務(wù)器:
1、下載所需要軟件:jdk.6 、apache-tomact-7.0.63-windows-x86_64.zip、nexus-2.9.0.war
2、加壓apache-tomact-7.0.63-windows-x86_64.zip、nexus-2.9.0.war
到:/myproram/(我建的目錄),接下來把nexus.war拷貝到C:\downloads\myprograms\apache-tomcat-7.0.63\webapps(我的myproram目錄)。然后到C:\downloads\myprograms\apache-tomcat-7.0.63\bin目錄下打開startup.bat
8、建一個本地倉庫文件目錄 maveh-repo
9、修改默認(rèn)的倉庫目錄進(jìn)入:C:\downloads\myprograms\apache-tomcat-7.0.63\webapps\nexus\WEB-INF\classes修改:nexus.properties文件,下面是我修改的路徑。
# WAR specific configuration requirements
#nexus-work=${user.home}/sonatype-work/nexus
nexus-work=e:/maven-repo/nexus//修改
runtime=${bundleBasedir}
nexus-app=${runtime}
10、配置maven使用本地倉庫服務(wù)器。進(jìn)入到maven所在的目錄下,(我的是在/soft/)即:/soft/maven/conf修改settings.xml配置文件如下:
1、<mirrors>
<mirror>
<id>nexus-osc</id>
<mirrorOf>central</mirrorOf>
<name>Nexus osc</name>
<url>http://192.168.92.1:8080/content/groups/public/</url>
</mirror>
<mirror>
<id>nexus-osc-thirdparty</id>
<mirrorOf>thirdparty</mirrorOf>
<name>Nexus osc thirdparty</name>
<url>http://192.168.92.1:8080/content/repositories/thirdparty/</url>
</mirror>
</mirrors>
2、 <profile>
<id>env-dev</id>
<activation>
<property>
<name>target-env</name>
<value>dev</value>
</property>
</activation>
<properties>
<tomcatPath>/path/to/tomcat/instance</tomcatPath>
</properties>
</profile>
-->
<profile>
<id>jdk-1.4</id>
<activation>
<jdk>1.4</jdk>
</activation>
<repositories>
<repository>
<id>nexus</id>
<name>local private nexus</name>
<url>http://192.168.92.1:8080/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>nexus</id>
<name>local private nexus</name>
<url>http://192.168.92.1:8080/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
(192.168.92.1是我本機(jī)的ip地址)
11、
啟動本地倉庫服務(wù)器
$>c:/myprograms/apache-tomcat-xxx/bin/startup.sh
12、登錄web管理界面
http://192.168.92.1:8080/nexus/
13、配置ubuntu下的maven使用win7的maven本地倉庫服務(wù)器
---------------------------------------------------
1.編輯/soft/maven/conf/settings.xml
進(jìn)入C:\downloads\myprograms\apache-maven-3.3.9\conf把settings.xml文件全部覆蓋復(fù)制給ubuntu里的settings.xml(/soft/maven/conf/settings.xml-----》ubuntu里的路徑)
同上!
另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)scvps.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務(wù)可用性高、性價比高”等特點與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場景需求。
分享標(biāo)題:Maven搭建本地倉庫-創(chuàng)新互聯(lián)
文章鏈接:http://aaarwkj.com/article18/cogddp.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站設(shè)計、品牌網(wǎng)站設(shè)計、微信公眾號、做網(wǎng)站、網(wǎng)站維護(hù)、關(guān)鍵詞優(yōu)化
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)