Terry.Li-彬

          虛其心,可解天下之問;專其心,可治天下之學;靜其心,可悟天下之理;恒其心,可成天下之業。

            BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理 ::
            143 隨筆 :: 344 文章 :: 130 評論 :: 0 Trackbacks
          <2025年7月>
          293012345
          6789101112
          13141516171819
          20212223242526
          272829303112
          3456789

          常用鏈接

          留言簿(19)

          隨筆分類(107)

          隨筆檔案(141)

          文章分類(284)

          文章檔案(342)

          相冊

          收藏夾(58)

          家裝

          最新隨筆

          搜索

          積分與排名

          最新評論

          閱讀排行榜

          評論排行榜

          1、下載war包,部署到tomcat中,啟動tomcat;
          2、訪問:http://xxx/nexus-1.1.1/index.html;
          3、用admin/admin123登錄;
          4、修改admin的密碼,但是不要修改別的屬性和修改別的用戶信息
          5、進入administration中的repositories,依次修改三個type是proxy的項目,將其Download Remote Indexes修改為true;然后郵件他們,分別re-index一下;
          6、將你自己機器上的manven緩存(一般是在C:\Documents and Settings\登錄名\.m2下面)全部拷貝到/home/你的用戶名/sonatype-work/nexus/storage下面的central和releases各一份;
          7、修改你本地的(一般是在C:\Documents and Settings\登錄名\.m2下面)setting.xml文件改成下面的:
          Xml代碼
          1. <settings>??
          2. ??????<proxies>??
          3. ????????<proxy>??
          4. ??????????<id>normal</id>??
          5. ??????????<active>true</active>??
          6. ??????????<protocol>http</protocol>??
          7. ??????????<username>deployment</username>??
          8. ??????????<password>deploy</password>??
          9. ??????????<host>172.19.0.177:8080/nexus-1.1.1</host>??
          10. ??????????<port>80</port>??
          11. ??????????<nonProxyHosts>172.19.0.177:8080/nexus-1.1.1</nonProxyHosts>??
          12. ????????</proxy>??
          13. ??????</proxies>??
          14. ??????<servers>??
          15. ??????</servers>??
          16. ??????<mirrors>??
          17. ?????????<mirror>??
          18. ??????????<id>nexus-public-snapshots</id>??
          19. ??????????<mirrorOf>public-snapshots</mirrorOf>??
          20. ??????????<url>http://172.19.0.177:8080/nexus-1.1.1/content/groups/public-snapshots</url>??
          21. ????????</mirror>??
          22. ????????<mirror>??
          23. ??????????<!--This?sends?everything?else?to?/public?-->??
          24. ??????????<id>nexus</id>??
          25. ??????????<mirrorOf>*</mirrorOf>??
          26. ??????????<url>http://172.19.0.177:8080/nexus-1.1.1/content/groups/public</url>??
          27. ????????</mirror>??
          28. ??????</mirrors>??
          29. ??????<profiles>??
          30. ????????<profile>??
          31. ??????????<id>development</id>??
          32. ??????????<repositories>??
          33. ????????????<repository>??
          34. ??????????????<id>central</id>??
          35. ??????????????<url>http://central</url>??
          36. ??????????????<releases><enabled>true</enabled></releases>??
          37. ??????????????<snapshots><enabled>true</enabled></snapshots>??
          38. ????????????</repository>??
          39. ??????????</repositories>??
          40. ?????????<pluginRepositories>??
          41. ????????????<pluginRepository>??
          42. ??????????????<id>central</id>??
          43. ??????????????<url>http://central</url>??
          44. ??????????????<releases><enabled>true</enabled></releases>??
          45. ??????????????<snapshots><enabled>true</enabled></snapshots>??
          46. ????????????</pluginRepository>??
          47. ??????????</pluginRepositories>??
          48. ????????</profile>??
          49. ????????<profile>??
          50. ??????????<id>public-snapshots</id>??
          51. ??????????<repositories>??
          52. ????????????<repository>??
          53. ??????????????<id>public-snapshots</id>??
          54. ??????????????<url>http://public-snapshots</url>??
          55. ??????????????<releases><enabled>false</enabled></releases>??
          56. ??????????????<snapshots><enabled>true</enabled></snapshots>??
          57. ????????????</repository>??
          58. ??????????</repositories>??
          59. ?????????<pluginRepositories>??
          60. ????????????<pluginRepository>??
          61. ??????????????<id>public-snapshots</id>??
          62. ??????????????<url>http://public-snapshots</url>??
          63. ??????????????<releases><enabled>false</enabled></releases>??
          64. ??????????????<snapshots><enabled>true</enabled></snapshots>??
          65. ????????????</pluginRepository>??
          66. ??????????</pluginRepositories>??
          67. ????????</profile>??
          68. ??????</profiles>??
          69. ????????<activeProfiles>??
          70. ????????<activeProfile>development</activeProfile>??
          71. ??????</activeProfiles>??
          72. </settings>??
          ?

          ??? 將172.19.0.177地址修改為你自己的服務器地址
          ???
          8、在你的項目中的pom.xml中增加一段:

          Xml代碼
          1. <distributionManagement>??
          2. ????????<repository>??
          3. ????????????<id>repo</id>??
          4. ????????????<name>public</name>??
          5. ????????????<url>http://172.19.0.177:8080/nexus-1.1.1/content/repositories/releases</url>??
          6. ????????</repository>??
          7. ????????<snapshotRepository>??
          8. ????????????<id>Snapshots</id>??
          9. ????????????<name>Snapshots</name>??
          10. ????????????<url>http://172.19.0.177:8080/nexus-1.1.1/content/repositories/snapshots</url>??
          11. ????????</snapshotRepository>??
          12. ????</distributionManagement>??
          ?


          這樣一來經過我的測試,如果你在沒有局域網的環境中(也就是沒辦法訪問你的私服),只要將pom里面的那段刪除就可以了。

          posted on 2010-09-26 00:16 禮物 閱讀(1372) 評論(0)  編輯  收藏 所屬分類: Maven2
          主站蜘蛛池模板: 思南县| 长沙县| 罗江县| 鄂托克前旗| 西贡区| 平顺县| 江油市| 临夏县| 当涂县| 定远县| 乐安县| 雅江县| 潮安县| 湄潭县| 慈利县| 阳新县| 额济纳旗| 临江市| 井陉县| 义乌市| 手游| 河津市| 吉隆县| 新宁县| 无锡市| 临桂县| 金华市| 伊宁县| 高密市| 台东县| 朝阳县| 盈江县| 长乐市| 绵竹市| 托里县| 台东市| 阿克陶县| 论坛| 灵石县| 青铜峡市| 廉江市|