【问题标题】:Spring and Maven plugin installation issue; mvn; springSpring 和 Maven 插件安装问题; mvn;春天
【发布时间】:2012-01-10 13:53:28
【问题描述】:

我有一个基于 maven 的项目,我正在尝试将其导入 Spring 源工具套件。我收到以下错误。

Description Resource    Path    Location    Type
Could not calculate build plan: Missing:
----------
1) org.apache.maven.plugins:maven-resources-plugin:maven-plugin:2.4.2

  Try downloading the file manually from the project website.

  Then, install it using the command: 
      mvn install:install-file -DgroupId=org.apache.maven.plugins -DartifactId=maven-resources-plugin -Dversion=2.4.2 -Dpackaging=maven-plugin -Dfile=/path/to/file

  Alternatively, if you host your own repository you can deploy the file there: 
      mvn deploy:deploy-file -DgroupId=org.apache.maven.plugins -DartifactId=maven-resources-plugin -Dversion=2.4.2 -Dpackaging=maven-plugin -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

----------
1 required artifact is missing.

for artifact: 
  org.apache.maven.plugins:maven-resources-plugin:maven-plugin:2.4.2

from the specified remote repositories:
  central (http://repo1.maven.org/maven2, releases=true, snapshots=false)
    Gamex       Unknown Maven Problem

看起来它要求我安装 maven 资源插件 2.4.2,但我不确定要下载的文件是什么。我尝试下载 maven-plugin-plugin-2.4.2-source.jar 并将其提供给命令;但它没有用。 然后我去http://svn.apache.org/viewvc/maven/plugins/tags/maven-resources-plugin-2.4.2/的maven仓库下载了pof.xml;这也行不通。 如果您之前遇到过此问题,请帮助我了解缺少什么/或错误消息是什么。

谢谢,

【问题讨论】:

标签: java eclipse spring maven maven-plugin


【解决方案1】:

您可能位于防火墙后面。您可以尝试设置HTTP 代理绕过防火墙。

在 Windows 中,此文件位于:C:\Documents and Settings\<windows Login>\.m2\settings.xml

您需要根据组织中网络的设置方式向<proxy> 提供有效参数。

<settings 
...
     <proxies>

    <proxy>
      <active>true</active>
      <protocol>http</protocol>
      <host>put-ur-proxy-servername</host>
      <port>80</port>
    </proxy>
...
</settings>

【讨论】:

    【解决方案2】:

    http://mirrors.ibiblio.org/pub/mirrors/maven2/org/apache/maven/plugins/maven-resources-plugin/2.4.2/下载maven资源插件2.4.2[maven-resources-plugin-2.4.2.jar]并做一个

          mvn install:install-file -DgroupId=org.apache.maven.plugins -DartifactId=maven-resources-plugin -Dversion=2.4.2 -Dpackaging=maven-plugin -Dfile=/path/to/file
    

    之后是 clean eclipse :eclipse ,在 Eclipse 中清理项目并刷新并尝试。它应该工作。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-02-04
      • 1970-01-01
      • 2010-10-01
      • 2011-01-09
      • 1970-01-01
      • 1970-01-01
      • 2021-10-02
      • 1970-01-01
      相关资源
      最近更新 更多