我已经在本地机器上配置了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)我在代理后面做了一些处理,代理配置在{HOME}/.m2/settings.xml and M2_HOME/conf/settings.xml.中更新了
原型生成命令在命令行中工作得很好。它通过代理下载依赖项。
任何帮助都是非常感谢的。
编辑2012年5月10日在eclipse中创建新的Maven Web项目时,原型"maven- archetype -webapp“版本显示为RELEASE。这是有联系的吗?
发布于 2013-04-03 21:52:35
我也有同样的问题。我通过将maven archetype catalog添加到eclipse修复了这个问题。具体步骤如下:
:
发布于 2012-10-16 21:08:58
我发现下面的tutorial非常有用。
Step1:用于创建web应用程序的maven命令: mvn archetype:generate -DgroupId=test.aasweb -DartifactId=TestWebApp -DarchetypeArtifactId=maven-archetype-webapp
Step2:以下条目已添加到项目的pom.xml中。
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<configuration>
<wtpapplicationxml>true</wtpapplicationxml>
<wtpversion>1.5</wtpversion>
<downloadSources>true</downloadSources>
<downloadJavadocs>true</downloadJavadocs>
<classpathContainers>
<classpathContainer>
org.eclipse.jst.j2ee.internal.web.container
</classpathContainer>
<classpathContainer>
org.eclipse.jst.j2ee.internal.module.container
</classpathContainer>
/classpathContainers>
<additionalProjectFacets>
<jst.web>2.5</jst.web>
<jst.jsf>1.2</jst.jsf>
</additionalProjectFacets>
</configuration>
</plugin>Step3:运行maven命令将其转换为eclipse项目格式。mvn eclipse:干净的eclipse:eclipse
Step4:将项目作为现有的Maven项目导入eclipse。
发布于 2013-08-12 19:37:25
如果您使用的是eclipse,可以按照这里的步骤(maven in 5 min not working)获取代理信息。完成后,请执行以下步骤:
根据您从上面的链接中获得的信息,转到Maven安装文件夹C:\apache-maven-3.1.0\conf\
settings.xml,在settings.xml中C:\Users\[UserFolder]\.m2
true 你的代理你的端口 http
Click Go>打开eclipse文件夹,转到: Windows > Preferences > Maven > User Settings
settings.xml from .m2 folder
现在,您可以尝试在Eclipse中创建Maven项目
https://stackoverflow.com/questions/12742467
复制相似问题