我完全是Maven的新手.我想用Eclipse Juno EE和原型"webapp"创建一个Maven项目.我安装了"Maven Integration for Eclipse WTP(孵化)",我还安装了"Maven Integration for Eclipse"(在Eclipse Marketplace的Installed选项卡上找到它).当我尝试从File-> New_> Maven Project创建新项目时,我得到错误:
Could not resolve archetype org.apache.maven.archetypes:maven-archetype-webapp:RELEASE from any of the configured repositories. Could not resolve artifact org.apache.maven.archetypes:maven-archetype-webapp:pom:RELEASE Failed to resolve version for org.apache.maven.archetypes:maven-archetype-webapp:pom:RELEASE: Could not find metadata org.apache.maven.archetypes:maven-archetype-webapp/maven-metadata.xml in local (C:\Documents and Settings\PEP35KD\.m2\repository) Failed to resolve version for org.apache.maven.archetypes:maven-archetype-webapp:pom:RELEASE: Could not find metadata org.apache.maven.archetypes:maven-archetype-webapp/maven-metadata.xml in local (C:\Documents and Settings\PEP35KD\.m2\repository)
它适用于各种原型.我正在使用代理,我使用以下内容在C:\ Documents and Settings\PEP35KD.m2 \下创建文件settings.xml:
<proxies>
<proxy>
<id>myId</id>
<active>true</active>
<protocol>http</protocol>
<username>rete\pep35kd</username>
<password>XXXX</password>
<host>XXXX</host>
<port>8080</port> …Run Code Online (Sandbox Code Playgroud) 我在本地机器上配置了maven3.0.3.已经安装了m2e eclipse插件.但是当我尝试使用maven-archetype-webapp创建一个新的maven项目时,我得到以下异常.
Could not resolve archetype org.apache.maven.archetypes:maven-archetype-webapp:RELEASE from any of the configured repositories.
Could not resolve artifact org.apache.maven.archetypes:maven-archetype- webapp:pom:RELEASE
Failed to resolve version for org.apache.maven.archetypes:maven-archetype- webapp:pom:RELEASE: Could not find metadata org.apache.maven.archetypes:maven-archetype- webapp/maven-metadata.xml in local ([HOME]/.m2/repository)
Failed to resolve version for org.apache.maven.archetypes:maven-archetype- webapp:pom:RELEASE: Could not find metadata org.apache.maven.archetypes:maven-archetype- webapp/maven-metadata.xml in local ([HOME]/.m2/repository)
Run Code Online (Sandbox Code Playgroud)
我在代理后面进行一些处理,并更新代理配置 {HOME}/.m2/settings.xml and M2_HOME/conf/settings.xml.
archetype generate命令在命令行中正常工作.它通过代理下载了依赖项.
任何帮助是极大的赞赏.
编辑05-10-2012在eclipse中创建一个新的Maven Web项目时,原型"maven-archetype-webapp"版本显示为RELEASE.无论如何这是否相关?