我尝试采取以下步骤: 右键单击pom.xml并在eclipse中运行maven install但我收到此错误:
[ERROR] Failed to execute goal on project tt: Could not resolve dependencies for project com.sunshineatnoon:tt:jar:0.0.1-SNAPSHOT: The following artifacts could not be resolved: org.apache.hbase:hbase:jar:0.96.1.1-hadoop2, com.yahoo.ycsb:core:jar:0.1.4: Failure to find org.apache.hbase:hbase:jar:0.96.1.1-hadoop2 in 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 -> [Help 1]
然而,当我查看http://repo.maven.apache.org/maven2时,确实存在这个org.apache.hbase:hbase:jar:0.96.1.1-hadoop2。
我的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.sunshineatnoon</groupId>
<artifactId>tt</artifactId>
<version>0.0.1-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.apache.hbase</groupId>
<artifactId>hbase</artifactId>
<version>0.96.1.1-hadoop2</version>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-client</artifactId>
<version>2.2.0</version>
</dependency>
<dependency>
<groupId>com.yahoo.ycsb</groupId>
<artifactId>core</artifactId>
<version>0.1.4</version>
</dependency>
</dependencies>
</project>
如何解决这个问题?提前感谢任何帮助!
答案 0 :(得分:2)
Maven将所有依赖项提取到本地计算机。默认路径为$ {USER_HOME} /.m2 / repository。在这里,您应该看到以下依赖项是否确实存在。你也在使用多个存储库吗? Maven会将文件放在文件夹下,认为存在冲突&#34; _maven.repositories&#34;我通常会删除这些,因为它也会产生上述错误。
org.apache.hbase:hbase:jar:0.96.1.1-hadoop2
${USER_HOME}/.m2/repository/org/apache/hbase/hbase/0.96.1.1-hadoop2
com.yahoo.ycsb:core:jar:0.1.4
${USER_HOME}/.m2/repository/com/yahoo/ycsb/core/0.1.4
答案 1 :(得分:1)
工件hbase-0.96.1.1-hadoop2不存在。自版本0.96起,hbase模块被分为多个子级。
hbase => hbase-client, hbase-protocol, hbase-server, hbase-examples ..
您需要引用hbase-(client | protocol | server | examples | etc)-0.96.1.1-hadoop2