我在下面尝试命令其正常工作
C:\Documents and Settings\users>mvn -v Apache Maven 3.0 (r1004208; 2010-10-04 17:20:56+0530) Java version: 1.6.0_21 Java home: C:\Program Files\Java\jdk1.6.0_21\jre Default locale: en_US, platform encoding: Cp1252 OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows"
并且一旦我尝试编译简单的HelloWorld.java
程序。它给我下面的错误...
C:\my-app>mvn compile [INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building Maven Quick Start Archetype 1.0-SNAPSHOT [INFO] ------------------------------------------------------------------------ Downloading: repo1.maven.org/maven2/org/apache/maven/plugins/maven-resour ces-plugin/2.4.3/maven-resources-plugin-2.4.3.jar [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 1.454s [INFO] Finished at: Thu Nov 18 13:08:50 IST 2010 [INFO] Final Memory: 1M/15M [INFO] ------------------------------------------------------------------------ [ERROR] Plugin org.apache.maven.plugins:maven-resources-plugin:2.4.3 or one of i ts dependencies could not be resolved: Could not transfer artifact org.apache.ma ven.plugins:maven-resources-plugin:jar:2.4.3 from central (http://repo1.maven.or g/maven2): Error transferring file: Connection refused: connect -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit ch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please rea d the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResoluti onException
请任何人用适当的解决方案更新我。
答案 0 :(得分:1)
仔细检查:
~/.m2/repository/org/apache/maven/plugins/maven-resources-plugin/
)答案 1 :(得分:0)
首先,你真的应该更好地格式化你的问题。只是剪切和粘贴而不考虑提交时的样子并不能帮助您快速简洁地回答。
其次,你的问题究竟是什么?你说主题说了一件事,但是你的文字又说了另一件事。
现在我将对你的主题和你的文字进行一次尝试。
就主题而言,Maven不会自动创建settings.xml文件。您必须创建它并按您希望的方式配置它。有关settings.xml的详细信息,请参阅此website。
就文本而言,看起来您无法访问Maven repo。这可以因为一些事情。最明显的是: