eclipse - 在 Eclipse(Kepler) 中创建 MAVEN 项目时出错

标签 eclipse maven eclipse-plugin

I am trying to create simple maven project in Eclipse . It is created but while building Workspace it is giving an Error . also there is an error in pom.xml.

<project 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/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.students.app</groupId>
  <artifactId>students-application</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-resources-plugin</artifactId>
            <version>2.5</version>
        </plugin>
    </plugins>
  </build>
</project>

This is my pom.xml I am getting an Error as following

Multiple annotations found at this line:
    - Failure to transfer org.apache.maven.plugins:maven-resources-
     plugin:pom:2.5 from http://repo.maven.apache.org/maven2 was cached in 
     the local repository, resolution will not be reattempted until the update 
     interval of central has elapsed or updates are forced. Original error: Could 
     not transfer artifact org.apache.maven.plugins:maven-resources-
     plugin:pom:2.5 from/to central (http://repo.maven.apache.org/maven2): 
     Connection refused: no further information to http://
     repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-
     resources-plugin/2.5/maven-resources-plugin-2.5.pom
    - Plugin execution not covered by lifecycle configuration: 
     org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile 
     (execution: default-compile, phase: compile)
    - Plugin execution not covered by lifecycle configuration: 
     org.apache.maven.plugins:maven-compiler-plugin:2.3.2:testCompile 
     (execution: default-testCompile, phase: test-compile)
    - CoreException: Could not calculate build plan: Plugin 
     org.apache.maven.plugins:maven-compiler-plugin:2.3.2 or one of its 
     dependencies could not be resolved: Failed to read artifact descriptor for 
     org.apache.maven.plugins:maven-compiler-plugin:jar:2.3.2: 
     ArtifactResolutionException: Failure to transfer 
     org.apache.maven.plugins:maven-compiler-plugin:pom:2.3.2 from http://
     repo.maven.apache.org/maven2 was cached in the local repository, 
     resolution will not be reattempted until the update interval of central has 
     elapsed or updates are forced. Original error: Could not transfer artifact 
     org.apache.maven.plugins:maven-compiler-plugin:pom:2.3.2 from/to 
     central (http://repo.maven.apache.org/maven2): Connection refused: no 
     further information to http://repo.maven.apache.org/maven2/org/apache/
     maven/plugins/maven-compiler-plugin/2.3.2/maven-compiler-
     plugin-2.3.2.pom 

what should I do?

最佳答案

问题可能是某些“.lastUpdated”可能会阻止您的下载,您需要删除“.lastUpdated”并更新 maven 项目。

找到 {user}/.m2/repository 并删除所有“*.lastUpdated”文件 你可以通过以下方式做到这一点

在 %USERPROFILE%.m2 中搜索 *.lastUpdated,然后删除 Eclipse 报告有问题的文件

cd %userprofile%\.m2\repository
for /r %i in (*.lastUpdated) do del %i

完成后,从 eclipse 更新您的 Maven 项目。

关于eclipse - 在 Eclipse(Kepler) 中创建 MAVEN 项目时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44193661/

相关文章:

eclipse - Eclipse:在构建配置之间切换不会更新排除的文件

java - Eclipse 终止键盘快捷键

java - 如何在 Eclipse 中定义 @since 标签?

eclipse - 从 Eclipse 中以编程方式安装 Eclipse 插件?

eclipse - 如何使用 ant 构建和安装 Eclipse 插件

java - Maven 对 Crystal 报表的依赖

css - 打包 gwt 客户端代码时丢失样式

maven - 在 Maven 3.0.5 中汇总 findbugs 报告

java - 尝试在 eclipse 中安装 mase 插件时出现错误消息

eclipse - Eclipse TCP/IP 监视器的独立替代方案