2011-06-09 57 views
1

我想創建一個EAR maven模塊項目(在eclipse中)ear-jee5作爲原型。它失敗,並出現以下錯誤。maven未能解決原型ear-jee5

Could not resolve archetype org.codehaus.mojo.archetypes:ear-jee5:1.3 from any of the configured repositories. 
Could not resolve artifact 
Missing org.codehaus.mojo.archetypes:ear-jee5:pom:1.3 

可能有人請幫我解決這個錯誤,或者給我的另一種方法來創建Maven的EAR模塊項目結構?

謝謝。

+0

您能夠創建任何* * Maven原型,或者是特定的一個失敗? – artbristol 2011-06-09 08:16:56

+0

看起來問題是辦公室的防火牆。添加未被防火牆阻止的鏡像解決了問題。 – 2011-06-09 08:35:59

回答

1

顯然,失敗似乎是因爲我在辦公室的代理/防火牆後面。解決方法是在settings.xml中添加代理配置或添加未被防火牆阻止的存儲庫鏡像。

希望這可以幫助別人。

添加代理

<proxies> 
    <!-- proxy 
    | Specification for one proxy, to be used in connecting to the network. 
    | 
    <proxy> 
     <id>optional</id> 
     <active>true</active> 
     <protocol>http</protocol> 
     <username>proxyuser</username> 
     <password>proxypass</password> 
     <host>proxy.host.net</host> 
     <port>80</port> 
     <nonProxyHosts>local.net|some.host.com</nonProxyHosts> 
    </proxy> 
    --> 
    </proxies> 

或鏡像

<mirrors> 
    <!-- mirror 
    | Specifies a repository mirror site to use instead of a given repository. The repository that 
    | this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used 
    | for inheritance and direct lookup purposes, and must be unique across the set of mirrors. 
    | 
    <mirror> 
     <id>mirrorId</id> 
     <mirrorOf>repositoryId</mirrorOf> 
     <name>Human Readable Name for this Mirror.</name> 
     <url>http://my.repository.com/repo/path</url> 
    </mirror> 
    <mirrors> 

感謝

+0

起初我有代理設置。但它不起作用。然後我嘗試設置鏡子。然後只能下載原型。結論是我需要同時執行代理和鏡像。感謝提示。 – huahsin68 2012-08-02 06:39:28