jeudi 5 mai 2016

Maven test fails because of package junit.org does not exist but tests do work in eclipse

I'm not very familiar with Maven so I'm sorry if I made an obvious mistake. I wrote some JUnit tests and the all run fine in eclipse when I right click the files and select "Run as JUnit". But when I try to use mvn test in the console it fails because it says package org.junit does not exist

Screenshot

This is how my pomfile looks:

<project xmlns="http://ift.tt/IH78KX" xmlns:xsi="http://ift.tt/ra1lAU" xsi:schemaLocation="http://ift.tt/IH78KX http://ift.tt/VE5zRx">
  <modelVersion>4.0.0</modelVersion>
  <groupId>Othello</groupId>
  <artifactId>Othello</artifactId>
  <version>0.0.1</version>
  <name>Othello</name>
  <build>
    <sourceDirectory>src</sourceDirectory>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.3</version>
        <configuration>
          <source/>
          <target/>
        </configuration>
      </plugin>
    </plugins>
    <finalName>Othello</finalName>
  </build>
  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.11</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
</project>

Does anyone know what I did wrong?

Aucun commentaire:

Enregistrer un commentaire