2014-02-25 70 views
1

我正嘗試使用命令propmt中的maven模板創建maven項目。但它看起來像下載jar和gatting失敗。 Maven版本是3.2.1。請告知爲什麼會發生這種情況?Maven - 無法使用maven模板創建項目

C:\工作區> MVN原型:產生-DgroupId = com.mkyong -DartifactId = CounterWebApp -DarchetypeArtifactId = Maven的原型 - web應用-Dinte ractiveMode =假 [INFO] Scanning for projects... Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom [WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-clean-plugin:2.5: Plugin org.apache.maven.plugins:maven-clean-plugin :2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.5 Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-install-plugin/2.4/maven-install-plugin-2.4.pom [WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-install-plugin:2.4: Plugin org.apache.maven.plugins:maven-install-pl ugin:2.4 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-install-plugin:jar:2. 4 Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-deploy-plugin/2.7/maven-deploy-plugin-2.7.pom [WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-deploy-plugin:2.7: Plugin org.apache.maven.plugins:maven-deploy-plug in:2.7 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-deploy-plugin:jar:2.7 Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-site-plugin/3.3/maven-site-plugin-3.3.pom

回答

2

你有工作代理?如果是這樣,你可以在%MAVEN_HOME%/ conf目錄/ settings.xml的檢查您的代理配置

<proxy> 
    <id>optional</id> 
    <active>true</active> 
    <protocol>http</protocol> 
    <username></username> 
    <password></password> 
    <host></host> 
    <port></port> 
    <nonProxyHosts>local.net|some.host.com</nonProxyHosts> 
</proxy> 

It's看起來,你是不是能夠連接到Maven倉庫

+0

好,結果。什麼只是我從apache下載了maven zip並設置了env.varaibles。爲什麼這是下載jar而不是引用本地文件夾?如果代理是必須的,那麼如何定義主機? – user2848031