我想使用原型为“ webapp”的Eclipse Juno EE创建一个Maven项目。我安装了“用于Eclipse WTP的Maven集成(孵化)”,并且还安装了“用于Eclipse的Maven集成”(在Eclipse Marketplace的“安装”选项卡上找到了它)。当我尝试从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:
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> <nonProxyHosts>localhost</nonProxyHosts> </proxy> </proxies>
请考虑一下,看来我不能从命令行使用mvn命令(找不到命令)。我从来没有安装过Maven本身,我认为插件就足够了:这是正确的假设吗?
更新问题肯定与代理有关。通过:
我有同样的问题。我通过将Maven原型目录添加到Eclipse中来修复它。下面提供了步骤:(请注意https协议)
Click ‘Add Remote Catalog’ and add the following:
目录文件:https : //repo1.maven.org/maven2/archetype-catalog.xml