2015-09-15 71 views
0

默认情况下,maven插件与最新的Eclipse IDE版本(例如Mars)集成。然而,在创建Maven项目它只是引发以下错误:未能在Eclipse Java EE IDE中创建maven项目

注:它不接受任何代理设置

Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failure to find org.apache.maven.plugins:maven-resources-plugin:jar:2.6 in http://localhost:8081/nexus/content/groups/public was cached in the local repository, resolution will not be reattempted until the update interval of nexus has elapsed or updates are forced Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failure to find org.apache.maven.plugins:maven-resources-plugin:jar:2.6 in http://localhost:8081/nexus/content/groups/public was cached in the local repository, resolution will not be reattempted until the update interval of nexus has elapsed or updates are forced

enter image description here enter image description here

工具使用:

Eclipse Java EE IDE for Web Developers. 
Version: Mars Release (4.5.0) 
+0

可能重复:http://stackoverflow.com/questions/12533885/could-not-calculate-build-plan-plugin-org-apache-maven-pluginsmaven-resources – soorapadman

+0

啊我明白,但它不是代理问题。刚刚注意到这个问题,并在xml文件中添加了镜像;我想我已经为这个问题给出了明确的答案;希望它会帮助很多用户:) –

回答

0

下面的xml文件对我来说确实欺骗了,这样做..

1 |在以下位置创建一个xml文件(settings.xml), C:\Users\username\.m2\settings.xml

2 |复制并粘贴下面包含多个镜像标签的XML代码片段。

3 |保存xml文件。

<settings xmlns="http://maven.apache.org/POM/4.0.0" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
         http://maven.apache.org/xsd/settings-1.0.0.xsd"> 
    <mirrors> 
     <mirror> 
      <id>ibiblio.org</id> 
      <url>http://mirrors.ibiblio.org/pub/mirrors/maven2</url> 
      <mirrorOf>central</mirrorOf> 
      <!-- United States, North Carolina --> 
     </mirror> 
     <mirror> 
      <id>lsu.edu</id> 
      <url>http://ibiblio.lsu.edu/main/pub/packages/maven2</url> 
      <mirrorOf>central</mirrorOf> 
      <!-- United States, Louisiana --> 
     </mirror> 
     <mirror> 
      <id>sateh.com</id> 
      <url>http://maven.sateh.com/repository</url> 
      <mirrorOf>central</mirrorOf> 
      <!-- The Netherlands, Amsterdam --> 
     </mirror> 
     <mirror> 
      <id>dotsrc.org</id> 
      <url>http://mirrors.dotsrc.org/maven2</url> 
      <mirrorOf>central</mirrorOf> 
      <!-- Denmark --> 
     </mirror> 
     <mirror> 
      <id>sunsite.dk</id> 
      <url>http://mirrors.sunsite.dk/maven2</url> 
      <mirrorOf>central</mirrorOf> 
      <!-- Denmark --> 
     </mirror> 
     <mirror> 
      <id>skynet.be</id> 
      <url>http://maven2.mirrors.skynet.be/pub/maven2</url> 
      <mirrorOf>central</mirrorOf> 
      <!-- Belgium --> 
     </mirror> 
     <mirror> 
      <id>cica.es</id> 
      <url>http://ftp.cica.es/mirrors/maven2</url> 
      <mirrorOf>central</mirrorOf> 
      <!-- Spain, Sevilla --> 
     </mirror> 
     <mirror> 
      <id>redv.com</id> 
      <url>http://mirrors.redv.com/maven2</url> 
      <mirrorOf>central</mirrorOf> 
      <!-- Shanghai, China --> 
     </mirror> 

     <!-- these just point to ibiblio.org --> 
     <mirror> 
      <id>ibiblio.net</id> 
      <url>http://www.ibiblio.net/pub/packages/maven2</url> 
      <mirrorOf>central</mirrorOf> 
      <!-- United States, North Carolina --> 
     </mirror> 
     <mirror> 
      <id>ggi-project.org</id> 
      <url>http://ftp.ggi-project.org/pub/packages/maven2</url> 
      <mirrorOf>central</mirrorOf> 
      <!-- The Netherlands, Amsterdam --> 
     </mirror> 
    </mirrors> 
    <profiles> 
     <profile> 
      <id>alwaysActiveProfile</id> 
      <repositories> 
       <repository> 
        <id>central</id> 
        <url>http://repo1.maven.org/maven2/</url> 
        <releases> 
         <enabled>true</enabled> 
        </releases> 
        <snapshots> 
         <enabled>true</enabled> 
        </snapshots> 
       </repository> 
      </repositories> 
     </profile> 
    </profiles> 
    <activeProfiles> 
     <activeProfile>alwaysActiveProfile</activeProfile> 
    </activeProfiles> 
</settings> 

4 |前往,Eclipse> Window>首选项> Maven>用户设置

5 |检查用户设置的位置

enter image description here

相关问题