寫程序,做產品,過日子

          成功其實很簡單,就是強迫自己堅持下去

          BlogJava 首頁 新隨筆 聯系 聚合 管理
            69 Posts :: 1 Stories :: 92 Comments :: 0 Trackbacks

          Maven 2的安裝和使用雖然不是一點即用,但也不是很復雜。然而,這兩天我新裝Maven,剛剛過了mvn -version,嘗試create maven project就出問題了。問題詳情如下。

          D:\mavenSample>mvn archetype:create -DgroupId=com.mycompany.app -DartifactId=my-app
          [INFO] Scanning for projects...
          [INFO] Searching repository for plugin with prefix: 'archetype'.
          [INFO] org.apache.maven.plugins: checking for updates from central
          [INFO] org.codehaus.mojo: checking for updates from central
          [INFO] artifact org.apache.maven.plugins:maven-archetype-plugin: checking for updates from central
          [INFO] ------------------------------------------------------------------------
          [ERROR] BUILD ERROR
          [INFO] ------------------------------------------------------------------------
          [INFO] The plugin 'org.apache.maven.plugins:maven-archetype-plugin' does not exist or no valid version could be found
          [INFO] ------------------------------------------------------------------------
          [INFO] For more information, run Maven with the -e switch
          [INFO] ------------------------------------------------------------------------
          [INFO] Total time: 3 seconds
          [INFO] Finished at: Wed Mar 19 14:26:49 CST 2008
          [INFO] Final Memory: 1M/2M
          [INFO] ------------------------------------------------------------------------

          開始以為是internet 代理設置有問題。網上也有帖子這么說。可是換到ADSL后,不用代理了,問題仍然存在。

          幾經周折后發現,原因在于我畫蛇添足多加了幾個鏡像,其中有的鏡像沒有同步更新maven庫。經過測試,如下maven 鏡像工作正常:

          <mirror>
          <id>ibiblio.org</id>
          <name>ibiblio Mirror of http://repo1.maven.org/maven2/</name>
          <url>http://mirrors.ibiblio.org/pub/mirrors/maven2</url>
          <mirrorOf>central</mirrorOf>
          <!-- United States, North Carolina -->
          </mirror>
          <mirror>
          <id>redv.com</id>
          <url>http://mirrors.redv.com/maven2</url>
          <mirrorOf>central</mirrorOf>
          <!-- Shanghai, China , Very fast-->
          </mirror>
          <mirror>
          <id>dotsrc.org</id>
          <url>http://mirrors.dotsrc.org/maven2</url>
          <mirrorOf>central</mirrorOf>
          <!-- Denmark -->
          </mirror>
          <mirror>
          <id>sunsite.dk</id>
          <url>http://mirrors.sunsite.dk/maven2</url>
          <mirrorOf>central</mirrorOf>
          <!-- Denmark -->
          </mirror>
          <mirror>
          <id>skynet.be</id>
          <url>http://maven2.mirrors.skynet.be/pub/maven2</url>
          <mirrorOf>central</mirrorOf>
          <!-- Belgium -->
          </mirror>
          <mirror>
          <id>cica.es</id>
          <url>http://ftp.cica.es/mirrors/maven2</url>
          <mirrorOf>central</mirrorOf>
          <!-- Spain, Sevilla -->
          </mirror>
          <!-- these just point to ibiblio.org -->
          <mirror>
          <id>ibiblio.net</id>
          <name>ibiblio.net Mirror of http://repo1.maven.org/maven2/</name>
          <url>http://www.ibiblio.net/pub/packages/maven2</url>
          <mirrorOf>central</mirrorOf>
          <!-- United States, North Carolina Fast-->
          </mirror>

          而下面的Maven鏡像都有問題。

          <mirror>
          <id>planetmirror</id>
          <name>Australian Mirror of http://repo1.maven.org/maven2/</name>
          <url>http://public.planetmirror.com/maven2/</url>
          <mirrorOf>central</mirrorOf>
          </mirror>
          <mirror>
          <id>lsu.edu</id>
          <url>http://ibiblio.lsu.edu/main/pub/packages/maven2</url>
          <mirrorOf>central</mirrorOf>
          <!-- United States, Louisiana -->
          </mirror>
          <mirror>
          <id>sateh.com</id>
          <url>http://maven.sateh.com/repository</url>
          <mirrorOf>central</mirrorOf>
          <!-- The Netherlands, Amsterdam -->
          </mirror>
          <mirror>
          <id>ggi-project.org</id>
          <url>http://ftp.ggi-project.org/pub/packages/maven2</url>
          <mirrorOf>central</mirrorOf>
          <!-- The Netherlands, Amsterdam -->
          </mirror>

          posted on 2008-08-13 12:40 Welkin Hu 閱讀(2011) 評論(0)  編輯  收藏 所屬分類: Java
          主站蜘蛛池模板: 东乌珠穆沁旗| 沁阳市| 枣强县| 贵定县| 屏南县| 布尔津县| 阿巴嘎旗| 中宁县| 安丘市| 三都| 潞城市| 比如县| 绥芬河市| 嘉义县| 扬中市| 临高县| 马边| 伽师县| 古交市| 海宁市| 定日县| 吉林省| 休宁县| 芜湖市| 菏泽市| 都昌县| 枞阳县| 武清区| 阿图什市| 墨玉县| 云浮市| 建阳市| 乌鲁木齐市| 苏尼特右旗| 唐山市| 怀化市| 崇明县| 呼图壁县| 太湖县| 上饶市| 桂阳县|