2013-05-21 106 views
3

当我尝试运行的Maven构建错误

mvn clean package 

我收到以下错误

Downloading: http://repo.maven.apache.org/maven2/org/apache/maven /plugins/maven-clean-plugin/2.4.1/maven-clean-plugin-2.4.1.pom 
[INFO] ------------------------------------------------------------------------ 
[INFO] Reactor Summary: 
[INFO] 
[INFO] YCSB Root ......................................... FAILURE [21.334s] 
[INFO] Core YCSB ......................................... SKIPPED 
[INFO] Cassandra DB Binding .............................. SKIPPED 
[INFO] HBase DB Binding .................................. SKIPPED 
[INFO] Hypertable DB Binding ............................. SKIPPED 
[INFO] DynamoDB DB Binding ............................... SKIPPED 
[INFO] ElasticSearch Binding ............................. SKIPPED 
[INFO] Infinispan DB Binding ............................. SKIPPED 
[INFO] JDBC DB Binding ................................... SKIPPED 
[INFO] Mapkeeper DB Binding .............................. SKIPPED 
[INFO] Mongo DB Binding .................................. SKIPPED 
[INFO] OrientDB Binding .................................. SKIPPED 
[INFO] Redis DB Binding .................................. SKIPPED 
[INFO] Voldemort DB Binding .............................. SKIPPED 
[INFO] YCSB Release Distribution Builder ................. SKIPPED 
[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD FAILURE 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 21.581s 
[INFO] Finished at: Sun Jun 23 14:32:40 IST 2013 
[INFO] Final Memory: 7M/238M 
[INFO] ------------------------------------------------------------------------ 
[ERROR] Plugin org.apache.maven.plugins:maven-clean-plugin:2.4.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.4.1: Could not transfer artifact org.apache.maven.plugins:maven-clean-plugin:pom:2.4.1 from/to central (http://repo.maven.apache.org/maven2): Connection to http://repo.maven.apache.org refused: Connection timed out -> [Help 1] 

pom.xml文件

<?xml version="1.0" encoding="UTF-8"?> 
<project xmlns="http://maven.apache.org/POM/3.0.5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://maven.apache.org/POM/3.0.5 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 
    <modelVersion>4.0.0</modelVersion> 

    <groupId>com.yahoo.ycsb</groupId> 
    <artifactId>root</artifactId> 
    <version>0.1.4</version> 
    <packaging>pom</packaging> 

    <name>YCSB Root</name> 

    <description> 
    This is the top level project that builds, packages the core and all the DB bindings for YCSB infrastructure. 
    </description> 
    <dependencies> 
    <!-- voldemort --> 
    <dependency> 
     <groupId>checkstyle</groupId> 
     <artifactId>checkstyle</artifactId> 
     <version>5.0</version> 
    </dependency> 
    <dependency> 
     <groupId>org.jdom</groupId> 
     <artifactId>jdom</artifactId> 
     <version>1.1</version> 
    </dependency> 
    <dependency> 
     <groupId>com.google.collections</groupId> 
     <artifactId>google-collections</artifactId> 
     <version>1.0</version> 
    </dependency> 
    <!-- 
    Nail down slf4j version to 1.6 so that it defaults to no-op logger. 
    http://www.slf4j.org/codes.html#StaticLoggerBinder 
    --> 
    <dependency> 
     <groupId>org.slf4j</groupId> 
     <artifactId>slf4j-api</artifactId> 
     <version>1.6.4</version> 
    </dependency> 

    <dependency> 
     <groupId>org.apache.hadoop</groupId> 
     <artifactId>hadoop-core</artifactId> 
     <version>1.0.1</version> 
    </dependency> 
    </dependencies> 


    <!-- Properties Management --> 
    <properties> 
    <maven.assembly.version>2.2.1</maven.assembly.version> 
    <hbase.version>0.94.3</hbase.version> 
    <cassandra.version>0.7.0</cassandra.version> 
    <infinispan.version>7.1.0.CR1</infinispan.version> 
    <openjpa.jdbc.version>2.1.1</openjpa.jdbc.version> 
    <mapkeeper.version>1.0</mapkeeper.version> 
    <mongodb.version>2.9.0</mongodb.version> 
    <orientdb.version>1.0.1</orientdb.version> 
    <redis.version>2.0.0</redis.version> 
    <voldemort.version>0.81</voldemort.version> 
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
    <thrift.version>0.8.0</thrift.version> 
    <hypertable.version>0.9.5.6</hypertable.version> 
    </properties> 


    <modules> 
    <!--module>build-tools</module--> 
    <module>cassandra</module> 
    <module>core</module> 
    <module>hbase</module> 
    <module>hypertable</module> 
    <module>dynamodb</module> 
    <module>elasticsearch</module> 
    <!--<module>gemfire</module>--> 
    <module>infinispan</module> 
    <module>jdbc</module> 
    <module>mapkeeper</module> 
    <module>mongodb</module> 
    <module>orientdb</module> 
    <!--module>nosqldb</module--> 
    <module>redis</module> 
    <module>voldemort</module> 
    <module>distribution</module> 
    </modules> 

    <build> 
    <plugins> 
     <plugin> 
     <groupId>org.apache.maven.plugins</groupId> 
     <artifactId>maven-compiler-plugin</artifactId> 
     <version>2.3.2</version> 
     <configuration> 
      <source>1.6</source> 
      <target>1.6</target> 
     </configuration> 
     </plugin> 
     <plugin> 
     <groupId>org.apache.maven.plugins</groupId> 
     <artifactId>maven-checkstyle-plugin</artifactId> 
     <version>2.6</version> 
     <configuration> 
      <consoleOutput>true</consoleOutput> 
      <configLocation>checkstyle.xml</configLocation> 
     </configuration> 
     <executions> 
      <execution> 
      <id>validate</id> 
      <phase>validate</phase> 
      <goals> 
       <goal>checkstyle</goal> 
      </goals> 
      </execution> 
     </executions> 
     </plugin> 
    </plugins> 
    </build> 
</project> 

通过wget的http://repo.maven.apache.org它没有显示任何错误。任何人都可以帮助我吗?

我想运行YCSB基准,我得到了这个错误。

+0

它在最后显示错误。 插件org.apache.maven.plugins:maven-clean-plugin:2.4.1或其某个依赖项无法解析:无法读取工件。 下载maven的新副本并将其配置为环境变量,然后重试。也用pom.xml更新您的文章 –

回答

3

由于错误说,你是不是能够连接到Maven仓库在:http://repo.maven.apache.org

尝试不同的存储库,details here或添加到您的POM,这样的:

<repository>    
      <id>central</id> 
      <name>Central</name> 
      <url>http://repo1.maven.org/maven2</url> 
</repository> 
+0

已添加pom.xml代码您可以检查它..感谢您的即时回复 – Rohit

+1

@Rohit您可能需要更改maven seetings.xml以配置te存储库。 settings.xml位于$ {user.home} /。m2/settings.xml下。按照此链接了解该文件,并知道如何配置存储库:http://maven.apache.org/settings.html –

+0

Thanx我明白了...代理问题 – Rohit

1

可以有2种可能性。

  1. 您遇到了连接中央存储库的问题。
  2. 有些事情不对在你的pom.xml

例外说,这个问题是不是在YCSB但在连接尝试下载Maven的清洁插件库中。

所以,在这里发送pom.xml,以防万一检查你的网络连接,然后再试一次。是否有机会通过使用代理的浏览器访问互联网,而maven直接进行,因此连接不可用?或者公司的防火墙检查用户代理并且不允许你连接到存储库?

编辑:

BTW似乎版本2.4.1不是在库中。至少可以手动查看1.0版本,1.0版本和1.5版本

+0

已添加pom.xml代码可以检查它..感谢您的即时回复 – Rohit

1

这可能会发生,如果你在代理的后面,请添加代理设置~/.m2/settings.xml并尝试。

例子:

<proxies> 
    <proxy> 
     <active>true</active> 
     <protocol>http</protocol> 
     <host>proxy host name</host> 
     <port>port</port> 
     <username>username</username> 
     <password>password</password> 
     <nonProxyHosts>exclutions</nonProxyHosts> 
    </proxy> 
</proxies> 
0

看起来像你的Maven无法连接到定义为拉动所需的构件库。你是否支持代理?在这种情况下,您需要在maven-conf-settings.xml中配置代理设置。