为什么mrunit 1.1.0 jar在Maven中央存储库中不可用

时间:2016-07-13 18:58:09

标签: maven mrunit hadoop-2.7.2

我尝试在maven项目中使用mrunit测试我的MapReduce 2作业。我从Maven中央仓库搜索并找到了结果:http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22org.apache.mrunit%22%20AND%20a%3A%22mrunit%22

在上面的链接中,最新的mrunit 1.1.0有hadoop1.jarhadoop2.jar而不是一个jar链接。正是由于这个原因,当我尝试添加相应的依赖项时

<dependency>
  <groupId>org.apache.mrunit</groupId>
  <artifactId>mrunit</artifactId>
  <version>1.1.0</version>
</dependency>

pom.xml并运行mvn package,我收到以下编译错误:Could not find artifact org.apache.mrunit:mrunit:jar:1.1.0 in central (https://repo.maven.apache.org/maven2 ...

有人可以帮忙解决这个问题吗?提前致谢

1 个答案:

答案 0 :(得分:7)

几个小时之后&#39;我自己的研究效率低下,得到了我的同事的答案:这是由maven的classifier标签解决的 - http://maven.apache.org/plugins/maven-deploy-plugin/examples/deploying-with-classifiers.html

所以在依赖元素

中添加了<classifier>hadoop2</classifier>