【问题标题】:Maven - Not able to create project using maven templateMaven - 无法使用 Maven 模板创建项目
【发布时间】:2014-03-28 00:46:26
【问题描述】:

我正在尝试使用命令 propmt 中的 maven 模板创建 maven 项目。但看起来下载 jar 并且 gatting 失败了。 Maven 版本是 3.2.1。请告知为什么会这样?

C:\workspace>mvn archetype:generate -DgroupId=com.mkyong -DartifactId=CounterWebApp -DarchetypeArtifactId=maven-archetype-webapp -Dinte ractiveMode=false [INFO] Scanning for projects... Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom [WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-clean-plugin:2.5: Plugin org.apache.maven.plugins:maven-clean-plugin :2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.5 Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-install-plugin/2.4/maven-install-plugin-2.4.pom [WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-install-plugin:2.4: Plugin org.apache.maven.plugins:maven-install-pl ugin:2.4 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-install-plugin:jar:2. 4 Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-deploy-plugin/2.7/maven-deploy-plugin-2.7.pom [WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-deploy-plugin:2.7: Plugin org.apache.maven.plugins:maven-deploy-plug in:2.7 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-deploy-plugin:jar:2.7 Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-site-plugin/3.3/maven-site-plugin-3.3.pom

【问题讨论】:

    标签: java apache maven maven-3


    【解决方案1】:

    您是否正在使用代理?如果是这样,您可以在 %MAVEN_HOME%/conf/settings.xml 中检查您的代理配置

     <proxy>
      <id>optional</id>
      <active>true</active>
      <protocol>http</protocol>
      <username></username>
      <password></password>
      <host></host>
      <port></port>
      <nonProxyHosts>local.net|some.host.com</nonProxyHosts>
    </proxy>
    

    您似乎无法连接到 maven 存储库

    【讨论】:

    • 很好,发现。我刚刚从 apache 下载了 maven zip 并设置了 env.varaibles。为什么要下载 jars 而不是引用本地文件夹?如果代理是必须的,那么如何定义主机?
    猜你喜欢
    • 2022-12-20
    • 1970-01-01
    • 1970-01-01
    • 2016-01-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-10-11
    • 1970-01-01
    相关资源
    最近更新 更多