我是Maven的新手,我经历了Apache站点中给出的配置步骤,但仍然无法对其进行配置。因此,任何人都可以通过简单的步骤来帮助我,以便在Windows中配置MAVEN。提前致谢。
编辑过
C:\Documents and Settings\arselv>mvn install
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Default Project
[INFO] task-segment: [install]
[INFO] ------------------------------------------------------------------------
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven- resources- plugin/2.3/maven-resources-plugin-2.3.pom
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-resources- plugin/2.3/maven-resources-plugin-2.3.pom
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).
Project ID: org.apache.maven.plugins:maven-resources-plugin
Reason: POM 'org.apache.maven.plugins:maven-resources-plugin' not found in repository: Unable to download the artifact from any repository
org.apache.maven.plugins:maven-resources-plugin:pom:2.3
from the specified remote repositories:
central (http://repo1.maven.org/maven2)
for project org.apache.maven.plugins:maven-resources-plugin
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 42 seconds
[INFO] Finished at: Fri Feb 05 13:10:06 IST 2010
[INFO] Final Memory: 2M/5M
[INFO] ------------------------------------------------------------------------
因此,上面是尝试执行apache站点中给出的步骤的错误提示。
最佳答案
如果您位于代理之后,则需要配置Maven to use this proxy。为此,请编辑或创建文件${user.home}/.m2/settings.xml
并向其中添加以下代码段:
<settings>
.
.
<proxies>
<proxy>
<active>true</active>
<protocol>http</protocol>
<host>proxy.somewhere.com</host>
<port>8080</port>
<username>proxyuser</username>
<password>somepassword</password>
<nonProxyHosts>www.google.com|*.somewhere.com</nonProxyHosts>
</proxy>
</proxies>
.
.
</settings>
关于maven-2 - 如何配置MAVEN?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/2205673/