2010-04-29 49 views
0

我剛來安裝maven2,配置了${user.home}/.m2中的settings.xml並修復了代理錯誤。現在,通過執行以下命令:訪問插件存儲庫的Maven2問題!

mvn -U archetype:create -DgroupId=maven-test -DartifactId=maven-test  
    -DpackageName=net.ensode.maventest 

我得到這個錯誤:

[INFO] Scanning for projects... 
[INFO] Searching repository for plugin with prefix: 'archetype'. 
[INFO] org.apache.maven.plugins: checking for updates from central 
[WARNING] repository metadata for: 'org.apache.maven.plugins' could not be retri 
eved from repository: central due to an error: Authorization failed: Access deni 
ed to: http://repo2.maven.org/maven2/org/apache/maven/plugins/maven-metadata.xml 

[INFO] Repository 'central' will be blacklisted 
[INFO] ------------------------------------------------------------------------ 
[ERROR] BUILD ERROR 
[INFO] ------------------------------------------------------------------------ 
[INFO] The plugin 'org.apache.maven.plugins:maven-archetype-plugin' does not exi 
st or no valid version could be found 
[INFO] ------------------------------------------------------------------------ 
[INFO] For more information, run Maven with the -e switch 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: < 1 second 
[INFO] Finished at: Thu Apr 29 16:05:40 CEST 2010 
[INFO] Final Memory: 2M/247M 
[INFO] ------------------------------------------------------------------------ 

的東西可能會導致它的主意?

的感謝!

+0

既然你提到了一個代理:代理是否需要授權? – bert 2010-04-29 14:26:24

回答

1

我認爲最可能的原因是您的代理需要您進行身份驗證,並且您尚未將驗證詳細信息配置到您的settings.xml文件中。

+0

@stephenC&@bert:是的,我在settings.xml中配置了代理 – achraf 2010-04-29 14:50:28

+0

我想不出任何其他解釋。 Maven Central不要求你登錄下載插件。 – 2010-04-29 14:56:39

+0

感謝堅持代理!我改變了代理地址,現在它可以工作。 – achraf 2010-04-29 15:09:23