5

I tried to test my MapReduce 2 job with mrunit in a maven project. I searched from Maven central repo and found the result: http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22org.apache.mrunit%22%20AND%20a%3A%22mrunit%22

In the link above, the latest mrunit 1.1.0 has hadoop1.jar and hadoop2.jar rather than one jar link. Just due to this reason, when I tried to add the corresponding dependencies

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

to pom.xml and run mvn package, I got the following compilation error: Could not find artifact org.apache.mrunit:mrunit:jar:1.1.0 in central (https://repo.maven.apache.org/maven2 ...

Could anyone help on how to fix this problem? Thanks in advance

Rui
  • 3,454
  • 6
  • 37
  • 70
  • Can you show the complete stack trace ? – Radouane ROUFID Jul 13 '16 at 19:09
  • Thanks for your reply. But I really don't think there is need to show the stack trace. As you can see from the link I sent. mrunit 1.1.0 has 2 jars. It can only work in case there is only one jar link – Rui Jul 13 '16 at 19:41

1 Answers1

10

After a few hours' inefficient research by myself, got the answer from my Colleague: this is solved by the maven's classifier tag - http://maven.apache.org/plugins/maven-deploy-plugin/examples/deploying-with-classifiers.html

so added <classifier>hadoop2</classifier> inside the dependency element

Rui
  • 3,454
  • 6
  • 37
  • 70