尝试在eclipse中运行maven项目时出错

时间:2014-05-21 03:01:48

标签: java eclipse maven

pom.xml文件:

<?xml version="1.0" encoding="UTF-8"?>
<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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>org.codehaus.sonar-plugins.java</groupId>
    <artifactId>java</artifactId>
    <version>2.3-SNAPSHOT</version>
  </parent>

  <artifactId>java-checks</artifactId>

  <name>SonarQube Java :: Checks</name>

  <dependencies>
    <dependency>
      <groupId>org.codehaus.sonar</groupId>
      <artifactId>sonar-deprecated</artifactId>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>java-squid</artifactId>
      <version>${project.version}</version>
    </dependency>

    <dependency>
      <groupId>org.codehaus.sonar.sslr</groupId>
      <artifactId>sslr-testing-harness</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest-all</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-all</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.easytesting</groupId>
      <artifactId>fest-assert</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-classic</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

</project>

我一直在尝试在eclipse上运行这个pom.xml,并且我一直有这样的错误:

  

[INFO]   -------------------------------------------------- ---------------------- [INFO] BUILD FAILURE [INFO]   -------------------------------------------------- ---------------------- [INFO]总时间:2:22.878s [INFO]完成时间:5月21日星期三10:53:12   CST 2014 [INFO]最终记忆:10M / 61M [INFO]   -------------------------------------------------- ---------------------- [错误]无法在项目java检查上执行目标:无法执行   解决项目的依赖关系   org.codehaus.sonar-plugins.java:java-checks:jar:2.3-SNAPSHOT:The   以下工件无法解决:   org.codehaus.sonar:声纳弃用:罐子:4.2-RC1,   org.codehaus.sonar:声纳插件的API中:jar:4.2-RC1,   org.codehaus.sonar:声纳检查-API中:jar:4.2-RC1,   org.codehaus.sonar:声纳colorizer中:jar:4.2-RC1,   org.codehaus.sonar:声纳图中:jar:4.2-RC1,   org.codehaus.sonar:声纳鱿鱼:罐子:4.2-RC1,   org.codehaus.sonar-plugins.java:java-squid:jar:2.3-SNAPSHOT:不能   转移工件org.codehaus.sonar:sonar-deprecated:jar:4.2-RC1   从/到中央(http://repo.maven.apache.org/maven2):没有回应   在60000之后收到 - &gt; [帮助1] [错误] [错误]查看完整   堆栈错误的痕迹,用-e开关重新运行Maven。 [错误]   使用-X开关重新运行Maven以启用完整的调试日志记录。 [错误]   [错误]有关错误和可能解决方案的更多信息,   请阅读以下文章:[错误] [帮助1]   http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

我需要添加到pom.xml吗?

1 个答案:

答案 0 :(得分:1)

全部在日志中:

No response received after 60000

Maven正在尝试下载您正在使用的插件的依赖项,并且由于超时而失败。检查您的网络连接,确保您可以访问Maven中央存储库(http://repo.maven.apache.org/maven2)。