2

I am new to Maven. I have created a Java Project for MRunit testing and converted it into Maven Project. I have added below dependencies into pom.xml file. However I don't see the Maven Dependencies folder or any downloads from the internet into the project. Please guide me.

<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>MRUnitTest</groupId>
<artifactId>MRUnitTest</artifactId>
<version>0.0.1-SNAPSHOT</version>
<build>
    <sourceDirectory>src</sourceDirectory>
    <plugins>
        <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.3</version>
            <dependencies>
                <dependency>
                    <groupId>org.apache.mrunit</groupId>
                    <artifactId>mrunit</artifactId>
                    <version>0.9.0-incubating</version>
                    <classifier>hadoop1</classifier>
                </dependency>
                <dependency>
                    <groupId>org.apache.hadoop</groupId>
                    <artifactId>hadoop-core</artifactId>
                    <version>1.2.1</version>
                </dependency>
            </dependencies>
            <configuration>
                <source>1.7</source>
                <target>1.7</target>
            </configuration>
        </plugin>
    </plugins>
</build>

2 Answers2

0

You will not find org.apache.mrunit with classifier hadoop1. remove the classifier property and the maven command

kuhajeyan
  • 10,727
  • 10
  • 46
  • 71
0

The dependencies are at the wrong place. Move it outside the build/plugin block, i.e

<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>MRUnitTest</groupId>
    <artifactId>MRUnitTest</artifactId>
    <version>0.0.1-SNAPSHOT</version>

    <dependencies>
        <dependency>
            <groupId>org.apache.mrunit</groupId>
            <artifactId>mrunit</artifactId>
            <version>0.9.0-incubating</version>
            <classifier>hadoop1</classifier>
        </dependency>
        <dependency>
            <groupId>org.apache.hadoop</groupId>
            <artifactId>hadoop-core</artifactId>
            <version>1.2.1</version>
        </dependency>
    </dependencies>

    <build>
       ....
    </build>
</project>

The classifier us fine according to mrunit doc. But you are selecting hadoop 1 with it.

openCage
  • 2,735
  • 1
  • 18
  • 24